File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed
Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -123,18 +123,18 @@ module.exports = (api, options) => {
123123 } ) )
124124 }
125125
126- if ( options . api === 'chrome' && isDevelopment ) {
127- const entries = { }
126+ // configure webpack-extension-reloader for automatic reloading of extension when content and background scripts change (not HMR)
127+ // enabled only when webpack mode === 'development'
128+ const entries = { }
128129
129- if ( pluginOptions . components . background ) {
130- entries . background = 'background'
131- }
130+ if ( pluginOptions . components . background ) {
131+ entries . background = 'background'
132+ }
132133
133- if ( pluginOptions . components . contentScripts ) {
134- entries . contentScript = Object . keys ( componentOptions . contentScripts . entries )
135- }
136- const ChromeExtensionReloader = require ( 'webpack-chrome-extension-reloader' )
137- webpackConfig . plugins . push ( new ChromeExtensionReloader ( { entries } ) )
134+ if ( pluginOptions . components . contentScripts ) {
135+ entries . contentScript = Object . keys ( componentOptions . contentScripts . entries )
138136 }
137+ const ExtensionReloader = require ( 'webpack-extension-reloader' )
138+ webpackConfig . plugins . push ( new ExtensionReloader ( { entries } ) )
139139 } )
140140}
Original file line number Diff line number Diff line change 2727 "@vue/cli-shared-utils" : " ^3.0.0-rc.3" ,
2828 "copy-webpack-plugin" : " ^4.5.2" ,
2929 "webpack" : " ^4.16.0" ,
30- "webpack-chrome- extension-reloader" : " ^0.8.3 " ,
30+ "webpack-extension-reloader" : " ^1.1.0 " ,
3131 "zip-webpack-plugin" : " ^3.0.0"
3232 }
3333}
You can’t perform that action at this time.
0 commit comments