modularscale / modularscale-sass

Modular scale calculator built into your Sass
http://www.modularscale.com
MIT License
1.98k stars 132 forks source link

Bower and NPM name difference #134

Closed bbohling closed 7 years ago

bbohling commented 7 years ago

We have a stylesheet/component that uses modularscale-sass that has worked as a bower component for a while now. However, now I want our component to be accessible via npm as well. The issue is that our stylesheet imports modularscale-sass as such:

@import "modular-scale/stylesheets/modular-scale";

Which works fine when it is installed via Bower. However, when it is installed via NPM that import statement would have to be modified to:

@import "modularscale-sass/stylesheets/modular-scale";

The path difference is due to the name property being different in modularscale-sass's bower.json and package.json. I'm assuming the NPM name had to be something different since modular-scale was already taken. I would prefer not to create another repo of our solution just for NPM (keeping two repos in sync due to 1-line of code...yuck), but off-hand I don't know how else to handle this situation. Any ideas?

strarsis commented 7 years ago

Instead hardcoding the paths, it may be advisable to use paths relative to modules folders (e.g. node_modules, bower_components) and instead use a proper import loader.

For ruby sass and raw node sass or sassc, sass-include-paths could be used. For node sass and node sass + eyeglass, also a custom importer could be used.

scottkellum commented 7 years ago

I’m gonna close this without action, it’s unfortunate the name was already taken in NPM but that’s what I get for using a common term instead of a unique name.