File tree 6 files changed +6011
-2484
lines changed 6 files changed +6011
-2484
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version" : " 0.2.0" ,
6
+ "configurations" : [
7
+ {
8
+ "type" : " node" ,
9
+ "request" : " launch" ,
10
+ "name" : " Launch Program" ,
11
+ "program" : " ${workspaceFolder}\\ test\\ spec\\ test.js" ,
12
+ "args" : [
13
+ " --input-type=module"
14
+ ]
15
+ }
16
+ ]
17
+ }
Original file line number Diff line number Diff line change 1
- var ExtractTextPlugin = require ( 'extract-text-webpack-plugin' ) ;
2
- var CSSSplitWebpackPlugin = require ( '../../' ) . default ;
1
+ const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' ) ;
2
+ const CSSSplitWebpackPlugin = require ( '../../' ) . default ;
3
+
4
+ const miniCssConfig = {
5
+ loader : MiniCssExtractPlugin . loader ,
6
+ options : {
7
+ // you can specify a publicPath here
8
+ // by default it uses publicPath in webpackOptions.output
9
+ publicPath : '../' ,
10
+ hmr : process . env . NODE_ENV === 'development' ,
11
+ } ,
12
+ } ;
3
13
4
14
module . exports = {
5
15
entry : './index.js' ,
@@ -10,19 +20,19 @@ module.exports = {
10
20
filename : 'bundle.js' ,
11
21
} ,
12
22
module : {
13
- loaders : [ {
23
+ rules : [ {
14
24
test : / \. c s s $ / ,
15
- loader : ExtractTextPlugin . extract . length !== 1 ?
16
- ExtractTextPlugin . extract ( 'style-loader' , 'css-loader' ) :
17
- ExtractTextPlugin . extract ( {
18
- fallbackLoader : 'style-loader' ,
19
- loader : 'css-loader' ,
20
- } ) ,
25
+ use : [
26
+ miniCssConfig ,
27
+ 'css-loader' ,
28
+ ] ,
21
29
} ] ,
22
30
} ,
23
31
devtool : 'source-map' ,
24
32
plugins : [
25
- new ExtractTextPlugin ( "styles.css" ) ,
33
+ new MiniCssExtractPlugin ( {
34
+ filename : 'styles.css' ,
35
+ } ) ,
26
36
new CSSSplitWebpackPlugin ( { size : 3 , imports : true } ) ,
27
37
] ,
28
38
} ;
Original file line number Diff line number Diff line change 1
- var ExtractTextPlugin = require ( 'extract-text-webpack-plugin' ) ;
2
- var CSSSplitWebpackPlugin = require ( '../../' ) . default ;
1
+ const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' ) ;
2
+ const CSSSplitWebpackPlugin = require ( '../../' ) . default ;
3
+
4
+ const miniCssConfig = {
5
+ loader : MiniCssExtractPlugin . loader ,
6
+ options : {
7
+ // you can specify a publicPath here
8
+ // by default it uses publicPath in webpackOptions.output
9
+ publicPath : '../' ,
10
+ hmr : process . env . NODE_ENV === 'development' ,
11
+ } ,
12
+ } ;
3
13
4
14
module . exports = {
5
15
entry : './index.js' ,
@@ -10,16 +20,20 @@ module.exports = {
10
20
filename : 'bundle.js' ,
11
21
} ,
12
22
module : {
13
- loaders : [ {
23
+ rules : [ {
14
24
test : / \. l e s s $ / ,
15
- loader : ExtractTextPlugin . extract (
16
- 'css?-url&-autoprefixer&sourceMap!less?sourceMap'
17
- ) ,
25
+ use : [
26
+ miniCssConfig ,
27
+ 'css-loader' ,
28
+ 'less-loader' ,
29
+ ] ,
18
30
} ] ,
19
31
} ,
20
32
devtool : 'source-map' ,
21
33
plugins : [
22
- new ExtractTextPlugin ( "styles.css" ) ,
34
+ new MiniCssExtractPlugin ( {
35
+ filename : 'styles.css' ,
36
+ } ) ,
23
37
new CSSSplitWebpackPlugin ( { size : 3 } ) ,
24
38
] ,
25
39
} ;
You can’t perform that action at this time.
0 commit comments