gpt4 book ai didi

webpack - Webpack 2.2.1 中的 BannerPlugin 错误

转载 作者:行者123 更新时间:2023-12-04 16:28:43 26 4
gpt4 key购买 nike

由于将 webpack 更新到 2.2.1,我在构建项目时收到此错误:

Error: BannerPlugin only takes one argument (pass an options object)

这是我使用插件的方式:
plugins: [
new webpack.DefinePlugin(GLOBALS),
new webpack.BannerPlugin('require("source-map-support").install();',
{ raw: true, entryOnly: false }),

],

无法弄清楚我做错了什么,根据文档似乎没问题。

最佳答案

看看https://webpack.js.org/guides/migrating/#bannerplugin-breaking-change .这是我能找到的关于更改的唯一文档。您版本中的第一个字符串参数作为“横幅”属性移动到配置对象中。

new webpack.BannerPlugin({banner: 'require("source-map-support").install();', raw: true, entryOnly: false})

关于webpack - Webpack 2.2.1 中的 BannerPlugin 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41956304/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com