How to simplify the @import path for my npm sass package? -


situation

i have developed small sass package , published on npm.

to use package in project npm install , import main file so:

@import 'node_modules/my-package/my-package.scss';

this works.

question

is possible allow users import so?

@import 'my-package';
or
@import 'my-package.scss';

i think saw packages allow this. possible?

any kind of appreciated!

with gulp , gulp-sass, people can specify includepaths

.pipe(sass({     includepaths: [         './node_modules/your-package-name'     ] })) 

this tell compiler includes appending path import compiling.

then in *.scss files need do

@import "your-package-name"; 

or

@import "your-package-name/variables"; 

otherwise, don't think it's possible similar setup - after all, it's url, unless pre-processing, need specify full path it


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -