normalize.scss icon indicating copy to clipboard operation
normalize.scss copied to clipboard

Support for main-bower-files

Open renarsvilnis opened this issue 9 years ago • 3 comments

Added support for main-bower-files.

renarsvilnis avatar Apr 13 '15 11:04 renarsvilnis

With your PR, main-bower-files can find only _normalize.scss, but _normalize.scss needs SCSS files in its sub-directories. I guess this does not work as expected in most cases.

Is it worth specifying a main field?

hail2u avatar Apr 13 '15 12:04 hail2u

Well all that main-bower-files does is adds imports to scss files from bower_components (depending on configuration), which it gets looking for main in bower.json.

// site.scss
@charset 'UTF-8';

// Vendors - all the CSS files from external libraries and frameworks
// bower:scss
// endbower

// Utils - gathers all Sass tools and helpers used across the project.
...

So the sub-directory scss files that _normalize.scssimports works great for cases, where you want to include all of normalize.

renarsvilnis avatar Apr 13 '15 12:04 renarsvilnis

In bower.json spec:

The primary acting files necessary to use your package.

So main field should be list of all SCSS files or unspecified. If not, it will be only useful to gulp/Grunt with main-bower-files. And maintaining list of files can be hard. This is the reason why I didn't specify main field in bower.json.

Another concern:

Preprocessor files like CoffeeScript should be compiled.

This clause rejects preprocessor files in main field. Leaving main field unspecified will be safest option, I think.

hail2u avatar Apr 13 '15 14:04 hail2u