@3yourmind/sass-node-modules-importer
v1.0.1
Published
SASS Importer That Handles node_modules with support for Lerna, package.json style, etc.
Downloads
114
Readme
@3yourmind/sass-node-modules-importer
node_modules
importer forsass
Usage
`rollup.config.js:
import sassNodeModulesImporter from '@3yourmind/sass-node-modules-importer'
import scss from 'rollup-plugin-scss'
export default [
scss({
// passed directly to sass
importer: sassNodeModulesImporter(),
importer: sassNodeModulesImporter({ debug: true }),
importer: sassNodeModulesImporter({ start: '~' }),
}),
]
@import '~normalize.css/'; // Trailing slash is important if module ends with .css as sass will not call the importer otherwise
Supported Sources
- (recursive) parent
node_modules
package.json
style
property- files ending with
importExtensions
index.css
Options
| name | default | type | description |
| ----------------: | :--------------------------- | :--------: | :--------------------------------------------------------------------------- |
| debug
| false
| boolean
| Enable debug logs |
| indexExtensions
| ['.css', '.sass', '.scss']
| string[]
| Extensions to resolve when extension is omitted. Will prefer based on order. |
| start
| ~
| string
| Prefix string/char to refer to node_modules
folders |