Repository: thgh/rollup-plugin-scss
Branch: v4
Commit: bf6f20399963
Files: 35
Total size: 30.6 KB
Directory structure:
gitextract_cyj5qkwz/
├── .github/
│ └── workflows/
│ └── test.yaml
├── .gitignore
├── .prettierignore
├── .vscode/
│ └── settings.json
├── CHANGELOG.md
├── LICENSE
├── README.md
├── index.ts
├── package.json
├── rollup.config.js
├── test/
│ ├── expected.js
│ ├── import-resolution/
│ │ ├── expected.css
│ │ ├── expected.js
│ │ ├── input.js
│ │ ├── input.scss
│ │ ├── main.js
│ │ ├── main.scss
│ │ ├── rollup.config.js
│ │ ├── setup.js
│ │ └── teardown.js
│ ├── input.js
│ ├── input.scss
│ ├── insert/
│ │ ├── expected.js
│ │ └── rollup.config.js
│ ├── node-sass/
│ │ ├── expected.css
│ │ └── rollup.config.js
│ ├── postcss/
│ │ ├── expected.css
│ │ └── rollup.config.js
│ ├── processor/
│ │ ├── expected.css
│ │ └── rollup.config.js
│ ├── sass/
│ │ ├── expected.css
│ │ └── rollup.config.js
│ └── sourcemap/
│ ├── expected.css
│ └── rollup.config.js
└── tsconfig.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/workflows/test.yaml
================================================
name: Node.js CI
on:
push:
branches: [v5, v4, v3, v2]
pull_request:
branches: [v5, v4, v3, v2]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: yarn --frozen-lockfile
- run: yarn build
- run: yarn test
================================================
FILE: .gitignore
================================================
# Logs
logs
*.log
npm-debug.log*
# Dependency directory
node_modules
# Unwanted
.idea
.DS_Store
# Build files
index.cjs.js
index.d.ts
index.es.js
/test/**/output.*
================================================
FILE: .prettierignore
================================================
expected.*
================================================
FILE: .vscode/settings.json
================================================
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"workbench.colorCustomizations": {
"activityBar.background": "#240",
"activityBarBadge.background": "#690",
"activityBar.activeBorder": "#690"
}
}
================================================
FILE: CHANGELOG.md
================================================
# Changelog
All notable changes to `rollup-plugin-scss` will be documented in this file.
## [Unreleased]
## [3.0.0] - 2021-06-29
### Added
- Add insert option @syJSdev
- Add `sourceMap` option to enable generation of source map @astappiev
- Add Yarn PnP support` @eagerestwolf
- Refactor to Typescript
- Automated testing using Github Actions
### Updated
- Prefer sass over node-sass
- A `processor` can receive map as second parameter and return `{ css: string, map?: string }`
- Remove `node-sass` from optionalDependencies @astappiev
**You have to specify `node-sass` or `sass` in your project dependencies alongside `rollup-plugin-scss`**
## [2.6.1] - 2020-10-01
### Updated
- Move node-sass to optionalDependencies @weizhenye
## [2.6.0] - 2020-08-14
### Fixed
- Resolve processor as a promise during transform step @geotrev
### Added
- Add support for postcss processor
## [2.5.0] - 2020-05-07
### Updated
- Fix includePaths before processing @mach25
## [2.4.0] - 2020-04-13
### Added
- Add `sass` option @riri
## [2.2.0] - 2020-04-11
### Added
- Add `watch` option @JimSchofield
## [2.1.0] - 2019-12-22
### Added
- Add `prefix` option @jackprosser
## [2.0.0] - 2019-12-22
### Changed
- Add `node_modules/` in includePaths by default
- Fix cases where output `css` is null or undefined
- Update dependencies
## [1.0.0] - 2019-02-04
### Update
- Update `ongenerate` to `generateBundle`
[unreleased]: https://github.com/thgh/rollup-plugin-scss/compare/v2.2.0...HEAD
[2.2.0]: https://github.com/thgh/rollup-plugin-scss/compare/v2.1.0...v2.2.0
[2.1.0]: https://github.com/thgh/rollup-plugin-scss/compare/v2.0.0...v2.1.0
[2.0.0]: https://github.com/thgh/rollup-plugin-scss/compare/v1.0.0...v2.0.0
[1.0.0]: https://github.com/thgh/rollup-plugin-scss/compare/v0.0.1...v1.0.0
[0.0.1]: https://github.com/thgh/rollup-plugin-scss/releases
================================================
FILE: LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2016 Thomas Ghysels
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# Rollup multiple .scss, .sass and .css imports
## Installation
```
npm install --save-dev rollup-plugin-scss sass
```
If any of them is installed, it will be used automatically, if both installed `sass` will be used.
## Usage
```js
// rollup.config.js
import scss from 'rollup-plugin-scss'
export default {
input: 'input.js',
output: {
file: 'output.js',
format: 'esm',
// Removes the hash from the asset filename
assetFileNames: '[name][extname]'
},
plugins: [
scss() // will output compiled styles to output.css
]
}
// OR
export default {
input: 'input.js',
output: { file: 'output.js', format: 'esm' },
plugins: [
scss({ fileName: 'bundle.css' }) // will output compiled styles to "bundle.css"
]
}
// OR
export default {
input: 'input.js',
output: { file: 'output.js', format: 'esm' },
plugins: [
scss() // will output compiled styles to "assets/output-123hash.css"
]
}
```
```js
// entry.js
import './reset.scss'
```
### Options
Options are passed to the sass compiler ([node-sass] by default). Refer to [ the Sass docs](https://sass-lang.com/documentation/js-api#options) for more details on these options.
One notable option is `indentedSyntax` which you'll need if you're parsing Sass syntax instead of Scss syntax. (e.g. when extracting a Vue `