diff --git a/README.md b/README.md index bf87dcd..560fafb 100644 --- a/README.md +++ b/README.md @@ -186,7 +186,13 @@ webWorkerLoader({ loadPath?: string, // This option is useful when the worker scripts need to be loaded from another folder. // Default: '' - skipPlugins?: Array // Plugin names to skip for web worker build + plugins?: Array, // An array of extra plugins to use while compiling the worker code. Used to apply + // transformations to the worker code and not the main code (i.e. minify) + // NOTE: these plugins be added to the rollop process on top of the plugins in the + // default configuration. + // Default: [] + + skipPlugins?: Array, // Plugin names to skip for web worker build // Default: [ 'liveServer', 'serve', 'livereload' ] }) ``` diff --git a/package.json b/package.json index 0e55c56..34b9595 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup-plugin-web-worker-loader", - "version": "1.7.0", + "version": "1.7.1", "description": "Rollup plugin to handle Web Workers", "main": "src/index.js", "repository": "https://github.com/darionco/rollup-plugin-web-worker-loader", diff --git a/src/index.js b/src/index.js index 1ad3abd..047c64c 100644 --- a/src/index.js +++ b/src/index.js @@ -23,6 +23,7 @@ const defaultConfig = { external: undefined, extensions: [ '.js' ], outputFolder: '', + plugins: [], skipPlugins: [ 'liveServer', 'serve', diff --git a/src/plugin/options.js b/src/plugin/options.js index c3a52db..5cfb419 100644 --- a/src/plugin/options.js +++ b/src/plugin/options.js @@ -11,6 +11,7 @@ function optionsImp(state, config, options) { } plugins.push(plugin); }); + plugins.push(...config.plugins); state.options.plugins = plugins; const cwd = process.cwd();