Skip to content

Commit

Permalink
feat: support SCSS chunks transformation with webpack (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
artkravchenko committed Aug 19, 2018
1 parent 94641fa commit e4e1ed3
Show file tree
Hide file tree
Showing 3 changed files with 400 additions and 20 deletions.
2 changes: 2 additions & 0 deletions packages/web-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
"eslint-plugin-react": "7.9.1",
"extract-css-chunks-webpack-plugin": "3.0.11",
"jest": "23.1.0",
"node-sass": "4.9.3",
"postcss-loader": "3.0.0",
"postcss-preset-env": "5.3.0",
"react-hot-loader": "4.3.3",
"sass-loader": "7.1.0",
"stats-webpack-plugin": "0.6.2",
"uglifyjs-webpack-plugin": "1.2.7",
"webpack": "4.12.0",
Expand Down
40 changes: 40 additions & 0 deletions packages/web-client/resources/build/webpack/app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,27 @@ if (__DEV__) {
getPostCssLoader(),
],
},
{
test: /\.scss$/,
exclude: /node_modules/,
use: [
ExtractCssChunksWebpackPlugin.loader,
{
loader: 'css-loader',
options: {
importLoaders: 2,
sourceMap: true,
},
},
getPostCssLoader(),
{
loader: 'sass-loader',
options: {
sourceMap: true,
},
},
],
},
],
},

Expand Down Expand Up @@ -200,6 +221,25 @@ if (__DEV__) {
options: { importLoaders: 1 },
},
getPostCssLoader(),
{
loader: 'sass-loader',
options: {
sourceMap: true,
},
},
],
},
{
test: /\.scss$/,
exclude: /node_modules/,
use: [
ExtractCssChunksWebpackPlugin.loader,
{
loader: 'css-loader',
options: { importLoaders: 2 },
},
getPostCssLoader(),
'sass-loader',
],
},
],
Expand Down
Loading

0 comments on commit e4e1ed3

Please sign in to comment.