I'm using webpack to bundle a bunch of javascript files together, and I need to include a copyright notice at the top of the file. I can't seem to figure out how to do that, or if it is possible.
The closest I've come is to use the raw loader, but that hides the copyright in an exported function. Any idea.
Something that is cross-platform is preferred.
You can use the webpack BannerPlugin. With this plugin you can add any string you want at the top of your bundled file.
I have used it to add some package name, version, license, and other info at the top of a library of my own.
module.exports = { // Other stuff plugins: [ new webpack.BannerPlugin('Your copyright notice') ] };
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With