is there any way to make Webpack keep the #!/usr/bin/env node
at the top of my file?
I\'m trying to bundle a CLI along with a module... it was a bit tri
You should be able to use BannerPlugin with raw mode for this. With this plugin you can add any string you want at the top of your bundle. By using the raw mode, it will not wrap the string in a comment.
In your webpack.config.js
file:
plugins: [
new webpack.BannerPlugin({ banner: "#!/usr/bin/env node", raw: true }),
]