Skip to content

Commit cc4bdd6

Browse files
authored
Merge pull request #62 from franciscolourenco/extension-reloader-options
Support config of webpack-extension-reloader
2 parents 45e50a1 + 21dde30 commit cc4bdd6

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ module.exports = {
120120

121121
See [Component options](#component-options).
122122

123+
- **extensionReloaderOptions**
124+
125+
- Type: `Object.<string, Object>`
126+
127+
See available options in [webpack-extension-reloader](https://github.com/rubenspgcavalcante/webpack-extension-reloader#how-to-use).
128+
123129
- **manifestSync**
124130

125131
- Type: `Array<string>`

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const manifestTransformer = require('./lib/manifest')
88
const defaultOptions = {
99
components: {},
1010
componentOptions: {},
11+
extensionReloaderOptions: {},
1112
manifestSync: ['version'],
1213
modesToZip: ['production'],
1314
manifestTransformer: null
@@ -24,6 +25,7 @@ module.exports = (api, options) => {
2425
? Object.assign(defaultOptions, options.pluginOptions.browserExtension)
2526
: defaultOptions
2627
const componentOptions = pluginOptions.componentOptions
28+
const extensionReloaderOptions = pluginOptions.extensionReloaderOptions
2729
const packageJson = require(api.resolve('package.json'))
2830
const isProduction = api.service.mode === 'production'
2931
const keyFile = api.resolve('key.pem')
@@ -105,7 +107,7 @@ module.exports = (api, options) => {
105107
// configure webpack-extension-reloader for automatic reloading of extension when content and background scripts change (not HMR)
106108
// enabled only when webpack mode === 'development'
107109
if (!isProduction) {
108-
webpackConfig.plugin('extension-reloader').use(ExtensionReloader, [{ entries }])
110+
webpackConfig.plugin('extension-reloader').use(ExtensionReloader, [{ entries, ...extensionReloaderOptions }])
109111
}
110112

111113
webpackConfig.plugin('copy').tap((args) => {

0 commit comments

Comments
 (0)