打包配置修改,pdf预览文件
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
e5330765af
commit
b453eede31
|
@ -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')
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue