Commit 5f99571b authored by YIyiyi's avatar YIyiyi

pref:添加打包生产zip文件

parent 40c5cc2a
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
"eslint": "^6.7.2", "eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2", "eslint-plugin-vue": "^6.2.2",
"fast-deep-equal": "^3.1.3", "fast-deep-equal": "^3.1.3",
"filemanager-webpack-plugin": "^8.0.0",
"gh-pages": "^3.1.0", "gh-pages": "^3.1.0",
"js-export-excel": "^1.1.4", "js-export-excel": "^1.1.4",
"less-loader": "^6.1.1", "less-loader": "^6.1.1",
......
...@@ -5,8 +5,8 @@ const { getThemeColors, modifyVars } = require("./src/utils/themeUtil"); ...@@ -5,8 +5,8 @@ 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 isProd = process.env.NODE_ENV === "production"; // const isDev = process.env.NODE_ENV === "development";
const FileManagerPlugin = require("filemanager-webpack-plugin"); // 压缩文件夹
const assetsCDN = { const assetsCDN = {
// webpack build externals // webpack build externals
// externals: { // externals: {
...@@ -56,13 +56,24 @@ module.exports = { ...@@ -56,13 +56,24 @@ module.exports = {
patterns: [path.resolve(__dirname, "./src/theme/theme.less")], patterns: [path.resolve(__dirname, "./src/theme/theme.less")],
}, },
}, },
//富文本改变图片大小插件
configureWebpack: { configureWebpack: {
plugins: [ plugins: [
//富文本改变图片大小插件
new webpack.ProvidePlugin({ new webpack.ProvidePlugin({
"window.Quill": "quill/dist/quill.js", "window.Quill": "quill/dist/quill.js",
Quill: "quill/dist/quill.js", Quill: "quill/dist/quill.js",
}), }),
// 生产环境打包zip文件
new FileManagerPlugin({
events: {
onEnd: {
mkdir: ["./dist"],
delete: ["./dist.zip"],
archive: [{ source: "./dist", destination: "./dist.zip" }],
},
},
}),
], ],
}, },
css: { css: {
......
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