Commit 147ff0cc authored by YIyiyi's avatar YIyiyi

pref:修改打包配置

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