File tree Expand file tree Collapse file tree 2 files changed +23
-32
lines changed Expand file tree Collapse file tree 2 files changed +23
-32
lines changed Original file line number Diff line number Diff line change 1- export   default  { 
1+ module . exports   =  { 
22  input : 'src/index.js' , 
33  output : { 
44    file : 'build/vue-html-to-paper.js' , 
55    name : 'VueHtmlToPaper' , 
6-     format : 'umd' 
7-   } 
6+     format : 'umd' , 
7+   } , 
88} ; 
Original file line number Diff line number Diff line change 1- const  path  =  require ( 'path' ) ; 
2- const   webpack  =  require ( 'webpack' ) ; 
1+ var  path  =  require ( 'path' ) ; 
2+ var   TerserPlugin  =  require ( 'terser- webpack-plugin ' ) ; 
33var  CompressionPlugin  =  require ( 'compression-webpack-plugin' ) ; 
44
55module . exports  =  { 
6+   mode : 'production' , 
67  entry : './src/index.js' , 
78  output : { 
89    library : 'VueHtmlToPaper' , 
910    libraryTarget : 'commonjs2' , 
1011    path : path . resolve ( __dirname ,  'dist' ) , 
11-     filename : 'index.js' 
12+     filename : 'index.js' , 
1213  } , 
1314  module : { 
1415    rules : [ 
1516      { 
1617        test : / \. c s s $ / , 
17-         loader :  'style-loader! css-loader!'  
18+         use :  [ 'style-loader'  ,   ' css-loader' ] , 
1819      } , 
1920      { 
20-         test : / \. j s $ / , 
21-         exclude : / ( n o d e _ m o d u l e s ) / , 
21+         test : / \. m ? j s $ / , 
22+         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 ) / , 
2223        use : { 
2324          loader : 'babel-loader' , 
2425          options : { 
25-             presets : [ 'env' ] 
26-           } 
27-         } 
28-       } 
29-     ] 
26+             presets : [ '@babel/preset- env' ] , 
27+           } , 
28+         } , 
29+       } , 
30+     ] , 
3031  } , 
3132  plugins : [ 
32-     new  webpack . optimize . UglifyJsPlugin ( { 
33-       mangle : true , 
34-       compress : { 
35-         warnings : false ,  // Suppress uglification warnings 
36-         pure_getters : true , 
37-         unsafe : true , 
38-         unsafe_comps : true , 
39-         screw_ie8 : true 
40-       } , 
41-       output : { 
42-         comments : false , 
43-       } , 
44-       exclude : [ / \. m i n \. j s $ / gi]  // skip pre-minified libs 
45-     } ) , 
4633    new  CompressionPlugin ( { 
4734      asset : "[path].gz[query]" , 
4835      algorithm : "gzip" , 
4936      test : / \. j s $ | \. c s s $ | \. h t m l $ / , 
5037      threshold : 10240 , 
51-       minRatio : 0 
52-     } ) 
53-   ] 
54- } 
38+       minRatio : 0 , 
39+     } ) , 
40+   ] , 
41+   optimization : { 
42+     minimize : true , 
43+     minimizer : [ new  TerserPlugin ( ) ] , 
44+   } , 
45+ } ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments