From 4d96c538dce04edb52861942a92c12fbdb4ccdc7 Mon Sep 17 00:00:00 2001 From: Heeexy Date: Wed, 20 Dec 2017 23:12:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=93=E5=8C=85=E6=97=B6?= =?UTF-8?q?=E7=BC=BA=E5=B0=91static=E6=96=87=E4=BB=B6=E5=A4=B9=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vue/build/webpack.prod.conf.js | 22 ++++------------------ vue/package.json | 2 +- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/vue/build/webpack.prod.conf.js b/vue/build/webpack.prod.conf.js index 7541838..790e1f9 100644 --- a/vue/build/webpack.prod.conf.js +++ b/vue/build/webpack.prod.conf.js @@ -11,12 +11,11 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin') const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') const UglifyJsPlugin = require('uglifyjs-webpack-plugin') -function resolve (dir) { +function resolve(dir) { return path.join(__dirname, '..', dir) } const env = require('../config/prod.env') - const webpackConfig = merge(baseWebpackConfig, { module: { rules: utils.styleLoaders({ @@ -57,8 +56,8 @@ const webpackConfig = merge(baseWebpackConfig, { // duplicated CSS from different components can be deduped. new OptimizeCSSPlugin({ cssProcessorOptions: config.build.productionSourceMap - ? { safe: true, map: { inline: false } } - : { safe: true } + ? {safe: true, map: {inline: false}} + : {safe: true} }), // generate dist index.html with correct asset hash for caching. // you can customize output by editing /index.html @@ -86,7 +85,7 @@ const webpackConfig = merge(baseWebpackConfig, { // split vendor js into its own file new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', - minChunks (module) { + minChunks(module) { // any required modules inside node_modules are extracted to vendor return ( module.resource && @@ -112,21 +111,10 @@ const webpackConfig = merge(baseWebpackConfig, { children: true, minChunks: 3 }), - - // copy custom static assets - new CopyWebpackPlugin([ - { - from: path.resolve(__dirname, '../static'), - to: config.build.assetsSubDirectory, - ignore: ['.*'] - } - ]) ] }) - if (config.build.productionGzip) { const CompressionWebpackPlugin = require('compression-webpack-plugin') - webpackConfig.plugins.push( new CompressionWebpackPlugin({ asset: '[path].gz[query]', @@ -141,10 +129,8 @@ if (config.build.productionGzip) { }) ) } - if (config.build.bundleAnalyzerReport) { const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin webpackConfig.plugins.push(new BundleAnalyzerPlugin()) } - module.exports = webpackConfig diff --git a/vue/package.json b/vue/package.json index 8b73e67..8892f29 100644 --- a/vue/package.json +++ b/vue/package.json @@ -1,5 +1,5 @@ { - "name": "vue-admin-template", + "name": "vue-admin", "version": "3.0.0", "license": "MIT", "description": "",