Skip to content

Commit

Permalink
replace ExtractTextPlugin by MiniCssExtractPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mastilver committed Sep 25, 2019
1 parent 73cbfcf commit 915f0f6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ node_js:
- '8.3.0'

env:
- WEBPACK_VERSION=4 EXTRACT_PLUGIN_VERSION=next
- WEBPACK_VERSION=4

install:
- npm install
- npm install webpack@$WEBPACK_VERSION extract-text-webpack-plugin@$EXTRACT_PLUGIN_VERSION || true
- npm install webpack@$WEBPACK_VERSION || true

script:
- npm test -- --forceExit
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"@svgr/webpack": "^4.3.3",
"codecov": "^3.6.1",
"css-loader": "^3.2.0",
"extract-text-webpack-plugin": "4.0.0-beta.0",
"file-loader": "^4.2.0",
"jest": "^24.9.0",
"memory-fs": "^0.4.1",
"mini-css-extract-plugin": "^0.8.0",
"react": "^16.9.0",
"rimraf": "^3.0.0",
"style-loader": "^1.0.0",
Expand Down
17 changes: 9 additions & 8 deletions spec/plugin.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ var path = require('path');
var MemoryFileSystem = require('memory-fs');
var webpack = require('webpack');
var _ = require('lodash');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');

var FakeCopyWebpackPlugin = require('./helpers/copy-plugin-mock');
var plugin = require('../index.js');

Expand Down Expand Up @@ -424,7 +425,7 @@ describe('ManifestPlugin', function() {
});
});

describe('with ExtractTextPlugin', function() {
describe('with MiniCssExtractPlugin', function() {
it('works when extracting css into a seperate file', function(done) {
webpackCompile({
context: __dirname,
Expand All @@ -440,17 +441,17 @@ describe('ManifestPlugin', function() {
module: {
rules: [{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader'
})
use: [
MiniCssExtractPlugin.loader,
'css-loader'
]
}]
},
plugins: [
new plugin(),
new ExtractTextPlugin({
new MiniCssExtractPlugin({
filename: '[name].css',
allChunks: true
// allChunks: true
})
]
}, {}, function(manifest, stats) {
Expand Down

0 comments on commit 915f0f6

Please sign in to comment.