Webpack Plugin for generating UserScript
$ npm i --save-dev userscript-webpack-plugin
The plugin will generate an UserScript file for you that includes all your webpack bundles. Just add the plugin to your webpack config as follows:
const UserScriptWebpackPlugin = require('userscript-webpack-plugin');
module.exports = {
...
plugins: [
new UserScriptWebpackPlugin(),
],
};