1.0.1 • Published 4 years ago

@3yourmind/sass-node-modules-importer v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@3yourmind/sass-node-modules-importer

node_modules importer for 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

namedefaulttypedescription
debugfalsebooleanEnable debug logs
indexExtensions['.css', '.sass', '.scss']string[]Extensions to resolve when extension is omitted. Will prefer based on order.
start~stringPrefix string/char to refer to node_modules folders