Commit 459aeeb3 authored by YIyiyi's avatar YIyiyi

feat:添加打包配置

parent 11490842
.DS_Store
node_modules
/dist
样表终端系统.zip
# local env files
.env.local
......
......@@ -5,7 +5,7 @@
"scripts": {
"serve": "vue-cli-service serve",
"dev": "vue-cli-service serve",
"build": "vue-cli-service build",
"build": "vue-cli-service build --mode production",
"lint": "vue-cli-service lint",
"test": "vue-cli-service build --mode test",
"build:prod": "vue-cli-service build --model prod"
......@@ -43,6 +43,7 @@
"@vue/cli-service": "~5.0.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3",
"filemanager-webpack-plugin": "^8.0.0",
"less": "^4.0.0",
"less-loader": "^8.0.0",
"svg-sprite-loader": "^4.1.6",
......
const { defineConfig } = require('@vue/cli-service')
const { defineConfig } = require("@vue/cli-service");
const FileManagerPlugin = require("filemanager-webpack-plugin"); // 压缩文件夹
const isDev = process.env.NODE_ENV === "development";
let plugins = [];
// 避免打本地启项目时自动打zip包
if (!isDev) {
plugins.push(
new FileManagerPlugin({
events: {
onEnd: {
mkdir: ["./dist"],
delete: ["./样表终端系统.zip"],
archive: [{ source: "./dist", destination: "./样表终端系统.zip" }],
},
},
})
);
}
module.exports = defineConfig({
transpileDependencies: true,
productionSourceMap: false,
assetsDir: 's',
lintOnSave:false,
lintOnSave: false,
// webpack 插件
configureWebpack: {
plugins: [...plugins],
},
transpileDependencies: true,
// 打包输出目录
outputDir: "dist/dist",
publicPath: "./",
devServer: {
port: 9086,
hot: "only",//自动保存
hot: "only", //自动保存
proxy: {
'/sampleform': {
target: 'http://localhost:17002',
"/sampleform": {
target: "http://localhost:17002",
changeOrigin: true,
secure: false,
cookieDomainRewrite: 'localhost',
}
}
}
})
cookieDomainRewrite: "localhost",
},
},
},
});
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment