Webpack Run Once plugin
This is a webpack plugin that enables developers to run specific webpack plugins only for the first compilation under webpack's watch mode.
Installation
npm install run-once-plugin --save-dev
Basic Usage
var RunOncePlugin = ;var HtmlWebpackPlugin = ; // third party pluginvar webpackConfig = entry: 'index.js' output: path: __dirname + '/dist' filename: 'index_bundle.js' plugins: name: 'parse-html1' // names must be different plugin: HtmlWebpackPlugin option: filename: './dist/index.html' template: `./template/index.ejs` inject: false excludeChunks: exclude chunksSortMode: 'dependency' name: 'parse-html2' plugin: HtmlWebpackPlugin option: {} ;
Configuration
The plugin accepts an array of plugins and their configuration.
name: string
works as keys for different pluginsplugin: {...}
to specify the plugin you want to useoption: any
to pass into the specified plugin