Skip to content

Commit 6426c58

Browse files
committed
Configure webpack to parse SCSS looking for Compass/CSS3 mixins. Always bundle them separately to JS.
1 parent 588ae39 commit 6426c58

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

webpack.config.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,34 @@ const config = {
2828
}
2929
}]
3030
},
31+
{
32+
test: /\.scss$/,
33+
use: [
34+
MiniCssExtractPlugin.loader, // creates style nodes from JS strings
35+
"css-loader", // translates CSS into CommonJS
36+
{
37+
loader: "sass-loader",
38+
options: {
39+
includePaths: ["node_modules/compass-mixins/lib"]
40+
}
41+
42+
}
43+
44+
// compiles Sass to CSS, using Node Sass by default
45+
]
46+
},
3147
{
3248
test: /\.sass$/,
3349
use: [
34-
"style-loader", // creates style nodes from JS strings
50+
MiniCssExtractPlugin.loader, // creates style nodes from JS strings
3551
"css-loader", // translates CSS into CommonJS
3652
"sass-loader" // compiles Sass to CSS, using Node Sass by default
3753
]
3854
},
3955
{
4056
test: /\.styl$/,
4157
use: [
42-
'style-loader',
58+
MiniCssExtractPlugin.loader,
4359
'css-loader',
4460
'stylus-loader'
4561
]

0 commit comments

Comments
 (0)