打包配置修改,pdf预览文件
continuous-integration/drone/push Build is passing Details

uat
wangxiaoshuang 2025-02-20 11:49:06 +08:00
parent e5330765af
commit b453eede31
1 changed files with 16 additions and 3 deletions

View File

@ -4,6 +4,7 @@ const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
const WebpackAliyunOss = require('webpack-aliyun-oss') const WebpackAliyunOss = require('webpack-aliyun-oss')
const MiniCssExtractPlugin = require('mini-css-extract-plugin') const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin') const CssMinimizerPlugin = require('css-minimizer-webpack-plugin')
const CopyPlugin = require('copy-webpack-plugin')
// const TerserWebpackPlugin = require('terser-webpack-plugin') // const TerserWebpackPlugin = require('terser-webpack-plugin')
const { resolve } = require('path') const { resolve } = require('path')
const webpack = require('webpack') const webpack = require('webpack')
@ -11,7 +12,7 @@ const defaultSettings = require('./src/settings.js')
const moment = require('moment') const moment = require('moment')
var distDate = moment(new Date()).format('YYYY-MM-DD') var distDate = moment(new Date()).format('YYYY-MM-DD')
const name = process.env.NODE_ENV === 'usa' ? 'LILI' : defaultSettings.title || 'IRCIS' // page title 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 // eslint-disable-next-line no-undef
module.exports = defineConfig({ module.exports = defineConfig({
// lintOnSave: false, // lintOnSave: false,
@ -83,7 +84,19 @@ module.exports = defineConfig({
asyncWebAssembly: true asyncWebAssembly: true
}, },
plugins: [ plugins: [
new CopyPlugin({
patterns: [
{
from: resolve(__dirname, './static'),
to: resolve(__dirname, './dist/static'),
globOptions: {
ignore: ['.*']
}
}
]
}),
// new BundleAnalyzerPlugin(),
process.env.NODE_ENV === 'development' || process.env.VUE_APP_OSS_CONFIG_BUCKET === 'zyypacs-usa' ? function () { } process.env.NODE_ENV === 'development' || process.env.VUE_APP_OSS_CONFIG_BUCKET === 'zyypacs-usa' ? function () { }
: new WebpackAliyunOss({ : new WebpackAliyunOss({
from: ['./dist/**'], from: ['./dist/**'],