const path = require('path')
const CopyWebpackPlugin = require('copy-webpack-plugin')
module.exports = {
configureWebpack: {
plugins: [
new CopyWebpackPlugin([
{
from: path.join(__dirname, 'functions'),
to: path.join(__dirname, 'unpackage/dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env.UNI_PLATFORM, 'functions')
}
])
]
}
}
百倍
- 发布:2020-08-14 16:40
- 更新:2020-12-10 10:08
- 阅读:1538
配置vue.config.js 编译时报错
分类:uni-app
将copy-webpack-plugin版本从6.4.0改为了6.0.0后这个错误解决,v6配置方式确实修改了,正确配置如下(注意将路径修改为自己的路径):
const path = require('path')
const CopyWebpackPlugin = require('copy-webpack-plugin')
module.exports = {
configureWebpack: {
plugins: [
new CopyWebpackPlugin({
patterns: [{
from: path.join(__dirname, 'wxcloudfunctions'),
to: path.join(__dirname, 'unpackage/dist', process.env.NODE_ENV === 'production' ? 'build' : 'dev', process.env
.UNI_PLATFORM, 'functions')
}]
})
]
}
}