Commit 11490842 authored by YIyiyi's avatar YIyiyi

feat:添加打包插件

parent 98f58d18
> 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": {
"dev": "vue-cli-service serve", "dev": "vue-cli-service serve",
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build": "vue-cli-service build", "build": "vue-cli-service build --mode production",
"test": "vue-cli-service build --mode test", "test": "vue-cli-service build --mode test",
"lint": "vue-cli-service lint", "lint": "vue-cli-service lint",
"stage": "vue-cli-service build --mode stage", "stage": "vue-cli-service build --mode stage",
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,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",
......
...@@ -329,4 +329,4 @@ export default { ...@@ -329,4 +329,4 @@ export default {
.el-switch .el-switch__label { .el-switch .el-switch__label {
width: 60px !important; /*开关按钮的宽度大小*/ width: 60px !important; /*开关按钮的宽度大小*/
} }
</style> </style>
\ No newline at end of file
...@@ -77,23 +77,24 @@ export default { ...@@ -77,23 +77,24 @@ export default {
methods: { methods: {
// 选择使用皮肤 // 选择使用皮肤
async changeSkin(device, row) { async changeSkin(device, row) {
if (row.check === "1") { // if (row.check === "1") {
// let obj = { // // let obj = {
// skin_id: "", // // skin_id: "",
// css_path: "", // // css_path: "",
// skin_name: "", // // skin_name: "",
// previewImagePath: "", // // previewImagePath: "",
// skinFieldList: "", // // skinFieldList: "",
// device, // // device,
// }; // // };
row.check = "0"; // row.check = "0";
console.log(check, device); // console.log(check, device);
// if (code === 1) { // // if (code === 1) {
// this.$message.success("设置" + msg); // // this.$message.success("设置" + msg);
// } // // }
} else { // } else {
row.check = "1"; // row.check = "1";
} // }
console.log(device, row);
}, },
// 预览皮肤 // 预览皮肤
handlePreview(url) { handlePreview(url) {
......
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', // webpack 插件
configureWebpack: {
lintOnSave:false, plugins: [...plugins],
devServer: { },
port: 8086, transpileDependencies: true,
hot: "only",//自动保存 // 打包输出目录
proxy: { outputDir: "dist/dist",
'/sampleform': { publicPath: "./",
target: 'http://localhost:17215', });
changeOrigin: true,
secure: false,
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