diff --git a/vue.config.js b/vue.config.js index d82ce448..c63cc912 100644 --- a/vue.config.js +++ b/vue.config.js @@ -4,6 +4,7 @@ const NodePolyfillPlugin = require('node-polyfill-webpack-plugin') const WebpackAliyunOss = require('webpack-aliyun-oss') const MiniCssExtractPlugin = require('mini-css-extract-plugin') const CssMinimizerPlugin = require('css-minimizer-webpack-plugin') +const CopyPlugin = require('copy-webpack-plugin') // const TerserWebpackPlugin = require('terser-webpack-plugin') const { resolve } = require('path') const webpack = require('webpack') @@ -11,7 +12,7 @@ const defaultSettings = require('./src/settings.js') const moment = require('moment') var distDate = moment(new Date()).format('YYYY-MM-DD') const name = process.env.NODE_ENV === 'usa' ? 'LILI' : defaultSettings.title || 'IRCIS' // page title - +const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; // eslint-disable-next-line no-undef module.exports = defineConfig({ // lintOnSave: false, @@ -83,8 +84,20 @@ module.exports = defineConfig({ asyncWebAssembly: true }, plugins: [ + new CopyPlugin({ + patterns: [ + { + from: resolve(__dirname, './static'), + to: resolve(__dirname, './dist/static'), + globOptions: { + ignore: ['.*'] + } - process.env.NODE_ENV === 'development' || process.env.VUE_APP_OSS_CONFIG_BUCKET === 'zyypacs-usa' ? function() { } + } + ] + }), + // new BundleAnalyzerPlugin(), + process.env.NODE_ENV === 'development' || process.env.VUE_APP_OSS_CONFIG_BUCKET === 'zyypacs-usa' ? function () { } : new WebpackAliyunOss({ from: ['./dist/**'], dist: process.env.VUE_APP_OSS_PATH + distDate, @@ -171,7 +184,7 @@ module.exports = defineConfig({ // 生成文件的最大体积 maxAssetSize: 3000000000, // 只给出js的性能提示 - assetFilter: function(assetFileName) { + assetFilter: function (assetFileName) { return assetFileName.endsWith('.js') } }