@3yourmind/sass-node-modules-importer
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.1 • Public • Published

    @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

    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

    Install

    npm i @3yourmind/sass-node-modules-importer

    DownloadsWeekly Downloads

    3

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    26.8 kB

    Total Files

    25

    Last publish

    Collaborators

    • moritzvetter
    • felix_bauer
    • dennis_hezel
    • 3yd_developer
    • cso_
    • juliogt
    • florianwendelborn
    • florentgallois
    • santiagoballadares