@@ -19,39 +19,37 @@ let configEnv = {};
19
19
20
20
if ( ENV === 'development' ) {
21
21
configEnv = {
22
- outputFolder : 'temp' ,
23
-
24
- compressing : false ,
22
+ output : {
23
+ filename : '[name].js'
24
+ } ,
25
25
26
- module : {
27
- rules : [ {
28
- enforce : 'pre' ,
29
- test : / S p e c \. j s $ / ,
30
- include : path . resolve ( __dirname , '../test' ) ,
31
- use : [ {
32
- loader : 'jshint-loader' ,
33
- options : {
34
- node : true ,
35
- globals : {
36
- angular : false ,
37
- inject : false ,
38
- jQuery : false ,
39
- jasmine : false ,
40
- afterEach : false ,
41
- beforeEach : false ,
42
- ddescribe : false ,
43
- describe : false ,
44
- expect : false ,
45
- iit : false ,
46
- it : false ,
47
- spyOn : false ,
48
- xdescribe : false ,
49
- xit : false
50
- }
26
+ rules : [ {
27
+ enforce : 'pre' ,
28
+ test : / S p e c \. j s $ / ,
29
+ include : path . resolve ( __dirname , '../test' ) ,
30
+ use : [ {
31
+ loader : 'jshint-loader' ,
32
+ options : {
33
+ node : true ,
34
+ globals : {
35
+ angular2 : false ,
36
+ inject : false ,
37
+ jQuery : false ,
38
+ jasmine : false ,
39
+ afterEach : false ,
40
+ beforeEach : false ,
41
+ ddescribe : false ,
42
+ describe : false ,
43
+ expect : false ,
44
+ iit : false ,
45
+ it : false ,
46
+ spyOn : false ,
47
+ xdescribe : false ,
48
+ xit : false
51
49
}
52
- } ]
50
+ }
53
51
} ]
54
- } ,
52
+ } ] ,
55
53
56
54
devtool : 'inline-source-map' ,
57
55
@@ -65,11 +63,12 @@ if (ENV === 'development') {
65
63
66
64
if ( ENV === 'production' ) {
67
65
configEnv = {
68
- outputFolder : 'dist' ,
69
-
70
- compressing : true ,
66
+ output : {
67
+ path : path . join ( __dirname , '../dist' ) ,
68
+ filename : '[name].js'
69
+ } ,
71
70
72
- module : { } ,
71
+ rules : [ ] ,
73
72
74
73
devtool : 'source-map' ,
75
74
@@ -79,6 +78,9 @@ if (ENV === 'production') {
79
78
} ,
80
79
81
80
plugins : [
81
+ new CleanWebpackPlugin ( 'dist' , {
82
+ root : path . join ( __dirname , '..' )
83
+ } ) ,
82
84
new webpack . optimize . UglifyJsPlugin ( {
83
85
sourceMap : true ,
84
86
compress : {
@@ -92,7 +94,8 @@ if (ENV === 'production') {
92
94
new CopyWebpackPlugin ( [
93
95
{ from : 'src/ui-scroll-jqlite.js' , to : 'ui-scroll-jqlite.min.js' } ,
94
96
{ from : 'src/ui-scroll-jqlite.js' , to : 'ui-scroll-jqlite.js' }
95
- ] , { copyUnmodified : true } )
97
+ ] , { copyUnmodified : true } ) ,
98
+ new webpack . BannerPlugin ( getBanner ( true ) )
96
99
] ,
97
100
98
101
watch : false
@@ -105,17 +108,14 @@ module.exports = {
105
108
'ui-scroll-grid' : path . resolve ( __dirname , '../src/ui-scroll-grid.js' )
106
109
} , configEnv . entry ) ,
107
110
108
- output : {
109
- path : path . join ( __dirname , '../' + configEnv . outputFolder ) ,
110
- filename : '[name].js'
111
- } ,
111
+ output : configEnv . output ,
112
112
113
113
cache : false ,
114
114
115
115
devtool : configEnv . devtool ,
116
116
117
117
module : {
118
- rules : [ ...configEnv . module . rules ,
118
+ rules : [ ...configEnv . rules ,
119
119
{
120
120
test : / \. j s $ / ,
121
121
exclude : / n o d e _ m o d u l e s / ,
@@ -135,13 +135,7 @@ module.exports = {
135
135
]
136
136
} ,
137
137
138
- plugins : [
139
- new CleanWebpackPlugin ( configEnv . outputFolder , {
140
- root : path . join ( __dirname , '..' )
141
- } ) ,
142
- ...configEnv . plugins ,
143
- new webpack . BannerPlugin ( getBanner ( configEnv . compressing ) )
144
- ] ,
138
+ plugins : configEnv . plugins ,
145
139
146
140
watch : configEnv . watch
147
141
} ;
0 commit comments