Commit 459aeeb3 authored by YIyiyi's avatar YIyiyi

feat:添加打包配置

parent 11490842
> 1% > 1%
last 2 versions last 2 versions
not dead not ie <= 10
.DS_Store .DS_Store
node_modules node_modules
/dist /dist
样表终端系统.zip
# local env files # local env files
.env.local .env.local
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"dev": "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", "lint": "vue-cli-service lint",
"test": "vue-cli-service build --mode test", "test": "vue-cli-service build --mode test",
"build:prod": "vue-cli-service build --model prod" "build:prod": "vue-cli-service build --model prod"
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
"@vue/cli-service": "~5.0.0", "@vue/cli-service": "~5.0.0",
"eslint": "^7.32.0", "eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3", "eslint-plugin-vue": "^8.0.3",
"filemanager-webpack-plugin": "^8.0.0",
"less": "^4.0.0", "less": "^4.0.0",
"less-loader": "^8.0.0", "less-loader": "^8.0.0",
"svg-sprite-loader": "^4.1.6", "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({ module.exports = defineConfig({
transpileDependencies: true, transpileDependencies: true,
productionSourceMap: false, productionSourceMap: false,
assetsDir: 's', lintOnSave: false,
// webpack 插件
lintOnSave:false, configureWebpack: {
plugins: [...plugins],
},
transpileDependencies: true,
// 打包输出目录
outputDir: "dist/dist",
publicPath: "./",
devServer: { devServer: {
port: 9086, port: 9086,
hot: "only",//自动保存 hot: "only", //自动保存
proxy: { proxy: {
'/sampleform': { "/sampleform": {
target: 'http://localhost:17002', target: "http://localhost:17002",
changeOrigin: true, changeOrigin: true,
secure: false, 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