Skip to content
This repository has been archived by the owner on Jun 5, 2021. It is now read-only.

Commit

Permalink
Use the MiniCssExtractPlugin loader in prod mode (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
borgstrom authored and fwouts committed Jan 10, 2019
1 parent 3348afa commit e1c5505
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions internal/web_bundle/create_webpack_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ module.exports = (
{
test: /\\.module\\.css$/,
use: [
"style-loader",
${
mode === "production"
? "MiniCssExtractPlugin.loader"
: '"style-loader"'
},
{
loader: "css-loader",
options: {
Expand All @@ -134,7 +138,11 @@ module.exports = (
{
test: /\\.css$/,
use: [
"style-loader",
${
mode === "production"
? "MiniCssExtractPlugin.loader"
: '"style-loader"'
},
"css-loader"
]
},
Expand Down Expand Up @@ -206,8 +214,8 @@ module.exports = (
${
mode === "production"
? `new MiniCssExtractPlugin({
filename: 'static/css/[name].[contenthash:8].css',
chunkFilename: 'static/css/[name].[contenthash:8].chunk.css',
filename: '[name].[contenthash].css',
chunkFilename: '[name].[contenthash].chunk.css',
}),`
: ""
}
Expand Down

0 comments on commit e1c5505

Please sign in to comment.