Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BannerPlugin error in Webpack 2.2.1

Tags:

webpack

Since updating webpack to 2.2.1, I'm getting this error while building the project:

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

This is how I use the plugin:

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

],

Can't figure our what I'm doing wrong, seems to be ok according to documentation.

like image 563
snk Avatar asked Jan 31 '17 11:01

snk


1 Answers

Take a look at https://webpack.js.org/guides/migrating/#bannerplugin-breaking-change. This was the only documentation I could find on the change. The first string argument in your version moves into the config object as a "banner" property.

new webpack.BannerPlugin({banner: 'require("source-map-support").install();', raw: true, entryOnly: false})
like image 76
Jason Ozias Avatar answered Nov 09 '22 10:11

Jason Ozias