提交 082689f6 作者: 毛细亚

更新打包设置

上级 4e5ffe01
......@@ -128,11 +128,12 @@
@change="handleInputRemark"
@blur="showInputRemark = false"
></el-input>
<i
class="el-icon-edit icon"
<svg-icon
icon-class="edit"
class="icon"
style="font-size: 14px"
@click="editRemark"
></i>
/>
</div>
<div class="item rowFlex columnCenter" v-if="lastTime">
<div class="rowFlex columnCenter">
......
const { defineConfig } = require('@vue/cli-service')
const path = require('path')
const fs = require('fs')
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin')
// 构建前删除 company_app 文件夹
function removeOutputDir() {
......@@ -20,8 +21,7 @@ function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = defineConfig({
// 非 dev 与 router base `/company_app` 对齐;prod 会提取 CSS,相对 publicPath 易导致 @font-face 路径在正式环境解析错误(Element 图标空白)
publicPath: process.env.NODE_ENV === 'development' ? '/' : '/company_app/',
publicPath: './',
assetsDir: 'static',
transpileDependencies: true,
outputDir: 'company_app',
......@@ -48,14 +48,29 @@ module.exports = defineConfig({
}
}
},
configureWebpack: {
name:'企微侧边栏',
// provide the app's title in webpack's name field, so that
// it can be accessed in index.html to inject the correct title.
resolve: {
alias: {
configureWebpack(config) {
config.name = '企微侧边栏'
config.resolve = config.resolve || {}
config.resolve.alias = {
...config.resolve.alias,
'@': resolve('src')
}
if (process.env.NODE_ENV === 'production') {
config.optimization = config.optimization || {}
config.optimization.minimizer = [
'...',
new CssMinimizerPlugin({
minimizerOptions: {
preset: [
'default',
{
normalizeUnicode: false
}
]
}
})
]
}
},
css: {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论