Skip to content

Commit b54ec7b

Browse files
David EllingsworthDavid Ellingsworth
authored andcommitted
Specify resolve option to be used with the sass-loader. This allows @import in sass files to locate a file to import based on the package.json file and to look for local files with the appropriate extentions when not specified.
1 parent b5750b2 commit b54ec7b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/config-generator.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,10 @@ class ConfigGenerator {
290290

291291
if (this.webpackConfig.useSassLoader) {
292292
rules.push({
293+
resolve: {
294+
mainFields: ['sass', 'style', 'main'],
295+
extensions: ['.scss', '.sass', '.css']
296+
},
293297
test: /\.s[ac]ss$/,
294298
use: cssExtractLoaderUtil.prependLoaders(this.webpackConfig, sassLoaderUtil.getLoaders(this.webpackConfig))
295299
});

0 commit comments

Comments
 (0)