-
Notifications
You must be signed in to change notification settings - Fork 8
/
vue.config.js
41 lines (39 loc) · 1.52 KB
/
vue.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const {defineConfig} = require('@vue/cli-service')
const CopyWebpackPlugin = require("copy-webpack-plugin")
module.exports = defineConfig({
transpileDependencies: true,
outputDir: "./dist", //打包目录
productionSourceMap: process.env.NODE_ENV === 'development', //排除.js.map
configureWebpack: {
plugins: [
require('unplugin-element-plus/webpack')({
// options
}),
new CopyWebpackPlugin({
patterns: [
{
from: './utools/',
to: './',
//处理传输内容
transform(content, absoluteFrom) {
//plugin.json 替换属性
if (absoluteFrom.endsWith("/plugin.json")) {
let jsonContent = JSON.parse(content.toString());
//替换
let result = JSON.stringify(jsonContent, function (key, value) {
if (key === 'main') {
value = 'index.html';
}
return value;
});
return Buffer.from(result);
}
return content;
},
}
]
})
],
},
publicPath: './',
})