Skip to content

Commit 1a18e8e

Browse files
committed
Fallback to style-loader when in development, no need to bundle CSS
1 parent fe4e8aa commit 1a18e8e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

webpack.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const config = {
3131
{
3232
test: /\.scss$/,
3333
use: [
34-
MiniCssExtractPlugin.loader, // creates style nodes from JS strings
34+
process.env.NODE_ENV !== 'production' ? 'style-loader' : MiniCssExtractPlugin.loader, // creates style nodes from JS strings
3535
"css-loader", // translates CSS into CommonJS
3636
{
3737
loader: "sass-loader",
@@ -47,15 +47,15 @@ const config = {
4747
{
4848
test: /\.sass$/,
4949
use: [
50-
MiniCssExtractPlugin.loader, // creates style nodes from JS strings
50+
process.env.NODE_ENV !== 'production' ? 'style-loader' : MiniCssExtractPlugin.loader, // creates style nodes from JS strings
5151
"css-loader", // translates CSS into CommonJS
5252
"sass-loader" // compiles Sass to CSS, using Node Sass by default
5353
]
5454
},
5555
{
5656
test: /\.styl$/,
5757
use: [
58-
MiniCssExtractPlugin.loader,
58+
process.env.NODE_ENV !== 'production' ? 'style-loader' : MiniCssExtractPlugin.loader,
5959
'css-loader',
6060
'stylus-loader'
6161
]

0 commit comments

Comments
 (0)