Skip to content

Commit 9303a82

Browse files
committed
replace ExtractTextPlugin by MiniCssExtractPlugin
1 parent 1402e8b commit 9303a82

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ node_js:
55
- '8.3.0'
66

77
env:
8-
- WEBPACK_VERSION=4 EXTRACT_PLUGIN_VERSION=next
8+
- WEBPACK_VERSION=4
99

1010
install:
1111
- npm install
12-
- npm install webpack@$WEBPACK_VERSION extract-text-webpack-plugin@$EXTRACT_PLUGIN_VERSION || true
12+
- npm install webpack@$WEBPACK_VERSION || true
1313

1414
script:
1515
- npm test -- --forceExit

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
"@svgr/webpack": "^4.3.3",
2020
"codecov": "^3.6.1",
2121
"css-loader": "^3.2.0",
22-
"extract-text-webpack-plugin": "4.0.0-beta.0",
2322
"file-loader": "^4.2.0",
2423
"jest": "^24.9.0",
2524
"memory-fs": "^0.4.1",
25+
"mini-css-extract-plugin": "^0.8.0",
2626
"react": "^16.9.0",
2727
"rimraf": "^3.0.0",
2828
"style-loader": "^1.0.0",

spec/plugin.spec.js

+9-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ var path = require('path');
33
var MemoryFileSystem = require('memory-fs');
44
var webpack = require('webpack');
55
var _ = require('lodash');
6-
var ExtractTextPlugin = require('extract-text-webpack-plugin');
6+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
7+
78
var FakeCopyWebpackPlugin = require('./helpers/copy-plugin-mock');
89
var plugin = require('../index.js');
910

@@ -424,7 +425,7 @@ describe('ManifestPlugin', function() {
424425
});
425426
});
426427

427-
describe('with ExtractTextPlugin', function() {
428+
describe('with MiniCssExtractPlugin', function() {
428429
it('works when extracting css into a seperate file', function(done) {
429430
webpackCompile({
430431
context: __dirname,
@@ -440,17 +441,17 @@ describe('ManifestPlugin', function() {
440441
module: {
441442
rules: [{
442443
test: /\.css$/,
443-
use: ExtractTextPlugin.extract({
444-
fallback: 'style-loader',
445-
use: 'css-loader'
446-
})
444+
use: [
445+
MiniCssExtractPlugin.loader,
446+
'css-loader'
447+
]
447448
}]
448449
},
449450
plugins: [
450451
new plugin(),
451-
new ExtractTextPlugin({
452+
new MiniCssExtractPlugin({
452453
filename: '[name].css',
453-
allChunks: true
454+
// allChunks: true
454455
})
455456
]
456457
}, {}, function(manifest, stats) {

0 commit comments

Comments
 (0)