@3yourmind/sass-node-modules-importer 中文文档教程
@3yourmind/sass-node-modules-importer
node_modules
sass
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 |
@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 |