Commit 147ff0cc authored by YIyiyi's avatar YIyiyi

pref:修改打包配置

parent 5f99571b
...@@ -8,7 +8,7 @@ yarn-error.log* ...@@ -8,7 +8,7 @@ yarn-error.log*
/test/unit/coverage/ /test/unit/coverage/
/test/e2e/reports/ /test/e2e/reports/
selenium-debug.log selenium-debug.log
.zip
# Editor directories and files # Editor directories and files
.idea .idea
.vscode .vscode
......
...@@ -5,8 +5,22 @@ const { getThemeColors, modifyVars } = require("./src/utils/themeUtil"); ...@@ -5,8 +5,22 @@ const { getThemeColors, modifyVars } = require("./src/utils/themeUtil");
const { resolveCss } = require("./src/utils/theme-color-replacer-extend"); const { resolveCss } = require("./src/utils/theme-color-replacer-extend");
const CompressionWebpackPlugin = require("compression-webpack-plugin"); const CompressionWebpackPlugin = require("compression-webpack-plugin");
const productionGzipExtensions = ["js", "css"]; const productionGzipExtensions = ["js", "css"];
// const isDev = process.env.NODE_ENV === "development"; const isDev = process.env.NODE_ENV === "development";
const FileManagerPlugin = require("filemanager-webpack-plugin"); // 压缩文件夹 const FileManagerPlugin = require("filemanager-webpack-plugin"); // 压缩文件夹
let plugins = [];
if (!isDev) {
plugins.push(
new FileManagerPlugin({
events: {
onEnd: {
mkdir: ["./dist"],
delete: ["./dist.zip"],
archive: [{ source: "./dist", destination: "./dist.zip" }],
},
},
})
);
}
const assetsCDN = { const assetsCDN = {
// webpack build externals // webpack build externals
// externals: { // externals: {
...@@ -64,16 +78,17 @@ module.exports = { ...@@ -64,16 +78,17 @@ module.exports = {
"window.Quill": "quill/dist/quill.js", "window.Quill": "quill/dist/quill.js",
Quill: "quill/dist/quill.js", Quill: "quill/dist/quill.js",
}), }),
...plugins,
// 生产环境打包zip文件 // 生产环境打包zip文件
new FileManagerPlugin({ // new FileManagerPlugin({
events: { // events: {
onEnd: { // onEnd: {
mkdir: ["./dist"], // mkdir: ["./dist"],
delete: ["./dist.zip"], // delete: ["./dist.zip"],
archive: [{ source: "./dist", destination: "./dist.zip" }], // archive: [{ source: "./dist", destination: "./dist.zip" }],
}, // },
}, // },
}), // }),
], ],
}, },
css: { css: {
...@@ -88,7 +103,7 @@ module.exports = { ...@@ -88,7 +103,7 @@ module.exports = {
}, },
publicPath: "./", publicPath: "./",
// publicPath: process.env.VUE_APP_PUBLIC_PATH, // publicPath: process.env.VUE_APP_PUBLIC_PATH,
outputDir: "dist", outputDir: "dist/dist",
assetsDir: "static", assetsDir: "static",
productionSourceMap: false, productionSourceMap: false,
}; };
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