1
- const webpack = require ( ' webpack' ) ;
2
- const CleanPlugin = require ( ' clean-webpack-plugin' ) ;
3
- const HtmlPlugin = require ( ' html-webpack-plugin' ) ;
4
- const ExtractTextPlugin = require ( ' extract-text-webpack-plugin' ) ;
5
- const commonPaths = require ( ' ./common-paths' ) ;
1
+ const webpack = require ( " webpack" ) ;
2
+ const CleanPlugin = require ( " clean-webpack-plugin" ) ;
3
+ const HtmlPlugin = require ( " html-webpack-plugin" ) ;
4
+ const ExtractTextPlugin = require ( " extract-text-webpack-plugin" ) ;
5
+ const commonPaths = require ( " ./common-paths" ) ;
6
6
7
7
const config = {
8
8
entry : {
9
- main : [ ' ./src/index.js' ]
9
+ main : [ " ./src/index.js" ]
10
10
} ,
11
11
output : {
12
- filename : ' [name].js' ,
12
+ filename : " [name].js" ,
13
13
path : commonPaths . outputPath
14
14
} ,
15
15
module : {
16
16
rules : [
17
17
{
18
- enforce : ' pre' ,
18
+ enforce : " pre" ,
19
19
test : / \. j s $ / ,
20
- loader : ' eslint-loader' ,
20
+ loader : " eslint-loader" ,
21
21
options : {
22
22
failOnWarning : false ,
23
23
failOnerror : true
@@ -29,23 +29,24 @@ const config = {
29
29
exclude : / ( n o d e _ m o d u l e s | b o w e r _ c o m p o n t e n t s ) / ,
30
30
use : [
31
31
{
32
- loader : ' babel-loader' ,
32
+ loader : " babel-loader" ,
33
33
options : {
34
- presets : [ 'es2015' , 'react' , 'stage-0' ]
34
+ presets : [ "@babel/preset-env" ]
35
35
}
36
36
}
37
- ] ,
38
- } , { test : / \. ( w o f f | w o f f 2 | e o t | t t f ) $ / , loader : 'url-loader?limit=100000' } ,
37
+ ]
38
+ } ,
39
+ { test : / \. ( w o f f | w o f f 2 | e o t | t t f ) $ / , loader : "url-loader?limit=100000" } ,
39
40
{
40
41
test : / \. s ? c s s $ / ,
41
42
use : ExtractTextPlugin . extract ( {
42
- fallback : ' style-loader' ,
43
+ fallback : " style-loader" ,
43
44
use : [
44
45
{
45
- loader : ' css-loader'
46
+ loader : " css-loader"
46
47
} ,
47
48
{
48
- loader : ' sass-loader'
49
+ loader : " sass-loader"
49
50
}
50
51
]
51
52
} )
@@ -54,9 +55,9 @@ const config = {
54
55
test : / \. ( p n g | s v g | j p g | g i f ) $ / ,
55
56
use : [
56
57
{
57
- loader : ' file-loader' ,
58
+ loader : " file-loader" ,
58
59
options : {
59
- name : ' images/[name].[ext]'
60
+ name : " images/[name].[ext]"
60
61
}
61
62
}
62
63
] ,
@@ -69,18 +70,18 @@ const config = {
69
70
cacheGroups : {
70
71
commons : {
71
72
test : / [ \\ / ] n o d e _ m o d u l e s [ \\ / ] / ,
72
- name : ' vendors' ,
73
- chunks : ' all'
73
+ name : " vendors" ,
74
+ chunks : " all"
74
75
}
75
76
}
76
77
}
77
78
} ,
78
79
plugins : [
79
80
new webpack . ProgressPlugin ( ) ,
80
- new ExtractTextPlugin ( ' [name].css' ) ,
81
- new CleanPlugin ( [ ' ../public' ] , { allowExternal : true } ) ,
81
+ new ExtractTextPlugin ( " [name].css" ) ,
82
+ new CleanPlugin ( [ " ../public" ] , { allowExternal : true } ) ,
82
83
new HtmlPlugin ( {
83
- filename : ' index.html' ,
84
+ filename : " index.html" ,
84
85
template : commonPaths . template ,
85
86
favicon : commonPaths . favicon ,
86
87
inject : true
0 commit comments