A Webpack4+ plugin for userscript projects.
It was a project prototype before v1.*, but it shows no flexibility and not customizable until it is a webpack plugin. For example, it did not support multiple scripts in a single project in v1.*. See issue #1.
- Make your userscript development combined with Webpack
With powerful Webpack support, you can even package everything in your userscript, e.g. icons and json data.
- Ability to generate userscript headers
- Ability to generate both
.meta.jsis used for update check containing headers only.
- Properly track files in watch mode
Including external header files and package.json.
npm i webpack-tampermonkey -D
Include the plugin in the
webpack.config.js as the following example.
const WebpackTampermonkey =moduleexports =plugins:
Examples can be found under the test fixture folder.
WebpackTampermonkey constructor has the following signature.
Also see the schema of options.
A path to a js or json file which exports a header object.
A function that returns a header object.
data contains the same variables as
A header object.
Also see explicit-config/webpack.config.js.