From 21dde303b3dc729cc553dd05aa3e1d211cc99581 Mon Sep 17 00:00:00 2001 From: Francisco Lourenco Date: Thu, 17 Oct 2019 21:52:16 +0200 Subject: [PATCH] Support config of webpack-extension-reloader --- README.md | 6 ++++++ index.js | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4a0f0f4..6a2a825 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,12 @@ module.exports = { See [Component options](#component-options). +- **extensionReloaderOptions** + + - Type: `Object.` + + See available options in [webpack-extension-reloader](https://github.com/rubenspgcavalcante/webpack-extension-reloader#how-to-use). + - **manifestSync** - Type: `Array` diff --git a/index.js b/index.js index 4fa9e3b..2f92ceb 100644 --- a/index.js +++ b/index.js @@ -8,6 +8,7 @@ const manifestTransformer = require('./lib/manifest') const defaultOptions = { components: {}, componentOptions: {}, + extensionReloaderOptions: {}, manifestSync: ['version'], modesToZip: ['production'], manifestTransformer: null @@ -24,6 +25,7 @@ module.exports = (api, options) => { ? Object.assign(defaultOptions, options.pluginOptions.browserExtension) : defaultOptions const componentOptions = pluginOptions.componentOptions + const extensionReloaderOptions = pluginOptions.extensionReloaderOptions const packageJson = require(api.resolve('package.json')) const isProduction = api.service.mode === 'production' const keyFile = api.resolve('key.pem') @@ -105,7 +107,7 @@ module.exports = (api, options) => { // configure webpack-extension-reloader for automatic reloading of extension when content and background scripts change (not HMR) // enabled only when webpack mode === 'development' if (!isProduction) { - webpackConfig.plugin('extension-reloader').use(ExtensionReloader, [{ entries }]) + webpackConfig.plugin('extension-reloader').use(ExtensionReloader, [{ entries, ...extensionReloaderOptions }]) } webpackConfig.plugin('copy').tap((args) => {