append content before or after js bundle
if entry key in webpack config is like this: const jsDirectory = path.join(__dirname, "build-prod/static/js"); const filename = main.js;
entry: {
"main": [path.join(jsDirectory, filename)],
},
then, please use the same key for chunks in banner-webpack-plugin
new BannerWebpackPlugin({
chunks: {
"main": {
afterContent: `"/** Hello World */"`,
},
},
}),
* beforeContent
- [String]
- append content before
* afterContent
- [String]
- append content after
var React = /******/ function(modules) { // webpackBootstrap
/** some code here */
/******/ }); /** Hello World */;