Add extensions option to enable configurable file extension matching #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sometimes it is useful to resolve files from
bower.main: []
which are not JS files. This PR adds anextensions
option which enables the configuration of the file extension/s to match.Example use case
The latest versions of the
sass-loader
package (7.x) builds upon more of Webpack's module resolution algorithm rather than following the simple algorithm built intonode-sass
.https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md#700-2018-04-13
This means to use
sass-loader
effectively you usually need to add some extraresolve
configuration to the Sass rule in order to resolve.scss
and.sass
files:However when using the new
sass-loader
package with this plugin to help resolve packages installed using Bower currently only.js
files will be matched so setting the file extension as shown above has no effect.My changes are intended to make it possible to use this plugin in situations like this where I want to resolve non-JavaScript files, e.g.:
I hope this makes sense! This is only a suggestion, if you are happy with it then I will update the readme as well.
cc webpack-contrib/sass-loader#556