1- 'use strict'
2- const path = require ( 'path' )
3- const utils = require ( './utils' )
4- const webpack = require ( 'webpack' )
5- const config = require ( '../config' )
6- const merge = require ( 'webpack-merge' )
7- const baseWebpackConfig = require ( './webpack.base.conf' )
8- const CopyWebpackPlugin = require ( 'copy-webpack-plugin' )
9- const HtmlWebpackPlugin = require ( 'html-webpack-plugin' )
10- const ExtractTextPlugin = require ( 'extract-text-webpack-plugin' )
11- const OptimizeCSSPlugin = require ( 'optimize-css-assets-webpack-plugin' )
12- const UglifyJsPlugin = require ( 'uglifyjs-webpack-plugin' )
1+ 'use strict' ;
2+ const path = require ( 'path' ) ;
3+ const utils = require ( './utils' ) ;
4+ const webpack = require ( 'webpack' ) ;
5+ const config = require ( '../config' ) ;
6+ const merge = require ( 'webpack-merge' ) ;
7+ const baseWebpackConfig = require ( './webpack.base.conf' ) ;
8+ const CopyWebpackPlugin = require ( 'copy-webpack-plugin' ) ;
9+ const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
10+ const ExtractTextPlugin = require ( 'extract-text-webpack-plugin' ) ;
11+ const OptimizeCSSPlugin = require ( 'optimize-css-assets-webpack-plugin' ) ;
12+ const UglifyJsPlugin = require ( 'uglifyjs-webpack-plugin' ) ;
1313
14- const env = require ( '../config/prod.env' )
14+ const env = require ( '../config/prod.env' ) ;
1515
1616const webpackConfig = merge ( baseWebpackConfig , {
1717 module : {
@@ -26,6 +26,7 @@ const webpackConfig = merge(baseWebpackConfig, {
2626 path : config . build . assetsRoot ,
2727 publicPath : config . build . assetsPublicPath ,
2828 filename : 'vue-fabric.min.js' ,
29+ chunkFilename : 'vue-fabric.[name].[chunkhash:8].js' ,
2930 library : 'vue-fabric' ,
3031 libraryTarget : 'umd'
3132 } ,
@@ -43,33 +44,32 @@ const webpackConfig = merge(baseWebpackConfig, {
4344 // extract css into its own file
4445 new ExtractTextPlugin ( {
4546 // filename: utils.assetsPath('css/[name].[contenthash].css')
46- filename : 'vue-fabric.min.css'
47+ filename : 'vue-fabric.min.css'
4748 } ) ,
4849 new OptimizeCSSPlugin ( )
4950 ]
50- } )
51+ } ) ;
5152
5253if ( config . build . productionGzip ) {
53- const CompressionWebpackPlugin = require ( 'compression-webpack-plugin' )
54+ const CompressionWebpackPlugin = require ( 'compression-webpack-plugin' ) ;
5455
5556 webpackConfig . plugins . push (
5657 new CompressionWebpackPlugin ( {
5758 asset : '[path].gz[query]' ,
5859 algorithm : 'gzip' ,
5960 test : new RegExp (
60- '\\.(' +
61- config . build . productionGzipExtensions . join ( '|' ) +
62- ')$'
61+ '\\.(' + config . build . productionGzipExtensions . join ( '|' ) + ')$'
6362 ) ,
6463 threshold : 10240 ,
6564 minRatio : 0.8
6665 } )
67- )
66+ ) ;
6867}
6968
7069if ( config . build . bundleAnalyzerReport ) {
71- const BundleAnalyzerPlugin = require ( 'webpack-bundle-analyzer' ) . BundleAnalyzerPlugin
72- webpackConfig . plugins . push ( new BundleAnalyzerPlugin ( ) )
70+ const BundleAnalyzerPlugin = require ( 'webpack-bundle-analyzer' )
71+ . BundleAnalyzerPlugin ;
72+ webpackConfig . plugins . push ( new BundleAnalyzerPlugin ( ) ) ;
7373}
7474
75- module . exports = webpackConfig
75+ module . exports = webpackConfig ;
0 commit comments