File tree Expand file tree Collapse file tree 2 files changed +55
-0
lines changed Expand file tree Collapse file tree 2 files changed +55
-0
lines changed Original file line number Diff line number Diff line change 15
15
" packages/core/test" ,
16
16
" packages/live-server"
17
17
]
18
+ },
19
+ "dependencies" : {
20
+ "babel-loader" : " ^7.1.5" ,
21
+ "webpack" : " ^4.16.3" ,
22
+ "webpack-stream" : " ^5.0.0"
18
23
}
19
24
}
Original file line number Diff line number Diff line change
1
+ // webpack.config.js
2
+ const UglifyJsPlugin = require ( 'uglifyjs-webpack-plugin' ) ;
3
+
4
+ module . exports = {
5
+ entry : {
6
+ 'patternlab-pattern' : './src/scripts/patternlab-pattern' ,
7
+ 'patternlab-viewer' : './src/scripts/patternlab-viewer' ,
8
+ } ,
9
+ output : {
10
+ path : `${ process . cwd ( ) } /dist/styleguide/js` ,
11
+ filename : '[name].js' ,
12
+ chunkFilename : `[name]-chunk-[chunkhash].js` ,
13
+ } ,
14
+ module : {
15
+ rules : [
16
+ {
17
+ test : / \. j s $ / ,
18
+ exclude : / ( n o d e _ m o d u l e s | b o w e r _ c o m p o n e n t s ) / ,
19
+ use : {
20
+ loader : 'babel-loader' ,
21
+ options : {
22
+ presets : [ '@babel/preset-env' ] ,
23
+ } ,
24
+ } ,
25
+ } ,
26
+ ] ,
27
+ } ,
28
+ cache : true ,
29
+ mode : 'production' ,
30
+ optimization : {
31
+ mergeDuplicateChunks : true ,
32
+ concatenateModules : true ,
33
+ minimizer : [
34
+ new UglifyJsPlugin ( {
35
+ sourceMap : true ,
36
+ parallel : true ,
37
+ cache : true ,
38
+ uglifyOptions : {
39
+ compress : true ,
40
+ mangle : true ,
41
+ output : {
42
+ comments : false ,
43
+ beautify : false ,
44
+ } ,
45
+ } ,
46
+ } ) ,
47
+ ] ,
48
+ } ,
49
+ plugins : [ ] ,
50
+ } ;
You can’t perform that action at this time.
0 commit comments