Skip to content
This repository has been archived by the owner on Sep 2, 2020. It is now read-only.

Commit

Permalink
Second attempt to fix CSS regression. 6.0.5 did not fix it.
Browse files Browse the repository at this point in the history
Use `mini-css-extract-plugin` instead of `extract-text-webpack-plugin`.

"How can I keep the css order in the css file when I use extract-text-webpack-plugin"
"TL;DR Use mini-css-extract-plugin instead"
webpack-contrib/extract-text-webpack-plugin#200
webpack-contrib/extract-text-webpack-plugin#200 (comment)
webpack-contrib/extract-text-webpack-plugin#701 (comment)
  • Loading branch information
montehurd committed May 5, 2018
1 parent 3060677 commit 81e5c81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"eslint-plugin-html": "4.0.3",
"eslint-plugin-jsdoc": "3.6.3",
"eslint-plugin-json": "1.2.0",
"extract-text-webpack-plugin": "4.0.0-beta.0",
"mini-css-extract-plugin": "0.4.0",
"mocha": "5.1.1",
"npm-check-updates": "3.0.0-alpha.3",
"npm-run-all": "4.1.2",
Expand Down
15 changes: 6 additions & 9 deletions webpack.config.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as path from 'path'
import * as pkg from './package.json'
import * as webpack from 'webpack'
import CleanPlugin from 'clean-webpack-plugin'
import ExtractTextPlugin from 'extract-text-webpack-plugin'
import MiniCssExtractPlugin from 'mini-css-extract-plugin'

const PRODUCTION = process.env.NODE_ENV === 'production'

Expand Down Expand Up @@ -50,13 +50,10 @@ const config = {
},
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: {
loader: 'style-loader',
options: { hmr: false }
},
use: [{ loader: 'css-loader', options: { minimize: false } }, 'postcss-loader']
})
use: [
MiniCssExtractPlugin.loader,
{ loader: 'css-loader', options: { minimize: false } }
]
}
]
},
Expand All @@ -80,7 +77,7 @@ const config = {
},
VERSION: JSON.stringify(pkg.version)
}),
new ExtractTextPlugin({ filename: '[name].css' })
new MiniCssExtractPlugin({ filename: '[name].css' })
]
}

Expand Down

0 comments on commit 81e5c81

Please sign in to comment.