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 }),
]