Skip to content

Commit 6750b78

Browse files
committed
Migrate the webpack configuration to be compatible with webpack 4
1 parent 8bea600 commit 6750b78

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

spec/index.spec.js

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ describe('HtmlWebpackInlineSourcePlugin', function () {
2222
path: OUTPUT_DIR
2323
},
2424
module: {
25-
loaders: [{ test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') }]
25+
rules: [{ test: /\.css$/, use: ExtractTextPlugin.extract({
26+
fallback: 'style-loader',
27+
use: 'css-loader'
28+
}) }]
2629
},
2730
plugins: [
2831
new ExtractTextPlugin('style.css'),
@@ -54,7 +57,10 @@ describe('HtmlWebpackInlineSourcePlugin', function () {
5457
path: OUTPUT_DIR
5558
},
5659
module: {
57-
loaders: [{ test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') }]
60+
rules: [{ test: /\.css$/, use: ExtractTextPlugin.extract({
61+
fallback: 'style-loader',
62+
use: 'css-loader'
63+
}) }]
5864
},
5965
// generate sourcemaps for testing URL correction
6066
devtool: '#source-map',
@@ -89,7 +95,10 @@ describe('HtmlWebpackInlineSourcePlugin', function () {
8995
path: OUTPUT_DIR
9096
},
9197
module: {
92-
loaders: [{ test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') }]
98+
rules: [{ test: /\.css$/, use: ExtractTextPlugin.extract({
99+
fallback: 'style-loader',
100+
use: 'css-loader'
101+
}) }]
93102
},
94103
plugins: [
95104
new ExtractTextPlugin('style.css?[hash]'),
@@ -120,7 +129,10 @@ describe('HtmlWebpackInlineSourcePlugin', function () {
120129
path: OUTPUT_DIR
121130
},
122131
module: {
123-
loaders: [{ test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') }]
132+
rules: [{ test: /\.css$/, use: ExtractTextPlugin.extract({
133+
fallback: 'style-loader',
134+
use: 'css-loader'
135+
}) }]
124136
},
125137
plugins: [
126138
new ExtractTextPlugin('style.css'),
@@ -150,7 +162,10 @@ describe('HtmlWebpackInlineSourcePlugin', function () {
150162
path: OUTPUT_DIR
151163
},
152164
module: {
153-
loaders: [{ test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') }]
165+
rules: [{ test: /\.css$/, use: ExtractTextPlugin.extract({
166+
fallback: 'style-loader',
167+
use: 'css-loader'
168+
}) }]
154169
},
155170
plugins: [
156171
new ExtractTextPlugin('style.css'),

0 commit comments

Comments
 (0)