Files
platformV2Web/admin/vue.config.js
张成 8309808835 1
2025-11-21 16:53:49 +08:00

36 lines
906 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const path = require("path");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const resolve = dir => {
return path.join(__dirname, dir);
};
let env = process.env.VUE_APP_ENV || process.env.NODE_ENV;
const sourceMap = env !== "production";
let BASE_URL = '/'
if (env === "production") {
BASE_URL = "/";
}
module.exports = {
baseUrl: BASE_URL,
// 如果你不需要使用eslint把lintOnSave设为false即可
lintOnSave: false,
chainWebpack: config => {
config.resolve.alias
.set("@", resolve("src"))
.set("@component", resolve("src/components"));
},
configureWebpack: {
output: {
filename: 'js/[name].[hash].js', // 默认使用 contenthash 和 chunk 名称
chunkFilename: 'js/[name].[hash].js', // 对于异步加载的 chunk 文件同样配置
}
},
// 设为false打包时不生成.map文件
productionSourceMap: sourceMap,
};