以前的dev依赖关系:
{
...
"webpack": "^4.14.0",
"webpack-cli": "3.0.8",
"webpack-dev-middleware": "3.1.3",
"copy-webpack-plugin": "^5.0.5",
}
现已更新为
{
...
"webpack": "^5.79.0",
"webpack-cli": "^4.5.0",
"webpack-dev-middleware": "^6.0.2",
"webpack-dev-server": "^4.13.3",
"webpack-hot-middleware": "^2.25.3",
"copy-webpack-plugin": "^11.0.0"
}
在以前的版本中,文件被复制
webpack.base.config.jsnew CopyWebpackPlugin([path.join(process.cwd(), 'app/workers/worker.js')])
现已更新
new CopyPlugin({
patterns: [
{
from: path.join(process.cwd(), 'app/workers/worker.js'),
to: 'workers',
},
],
}),
完全没有被复制。
我尝试将输出文件夹更改为“/”或path.join(process.cwd(), 'app/workers/worker.js')"
仍然不起作用
1条答案
按热度按时间8i9zcol21#
在我去掉“to”部分后,它现在可以工作了