Skip to content

Commit 0f9657f

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

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
@@ -227,6 +227,10 @@ class ConfigGenerator {
227227
use: babelLoaderUtil.getLoaders(this.webpackConfig)
228228
},
229229
{
230+
resolve: {
231+
mainFields: ['style', 'main'],
232+
extensions: ['.css'],
233+
},
230234
test: /\.css$/,
231235
use: cssExtractLoaderUtil.prependLoaders(this.webpackConfig, cssLoaderUtil.getLoaders(this.webpackConfig))
232236
}

0 commit comments

Comments
 (0)