File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
programs/develop/webpack/plugin-extension/feature-scripts/steps/setup-reload-strategy Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 11import * as fs from 'fs'
22import { type Compiler } from '@rspack/core'
3+ import WebExtensionFork from './webpack-target-webextension-fork'
34import WebExtension from 'webpack-target-webextension'
45import { filterKeysForThisBrowser } from '../../scripts-lib/manifest'
56import { SetupBackgroundEntry } from './setup-background-entry'
@@ -76,9 +77,16 @@ export class SetupReloadStrategy {
7677
7778 // 4 - Now that we know the background exists, add the web extension target
7879 // using it. This is our core upstream plugin.
79- new WebExtension ( {
80- background : this . getEntryName ( patchedManifest ) ,
81- weakRuntimeCheck : true
82- } ) . apply ( compiler as any )
80+ if ( process . env . EXTENSION_EXPERIMENTAL_HMR === 'true' ) {
81+ new WebExtensionFork ( {
82+ background : this . getEntryName ( patchedManifest ) ,
83+ weakRuntimeCheck : true
84+ } ) . apply ( compiler as any )
85+ } else {
86+ new WebExtension ( {
87+ background : this . getEntryName ( patchedManifest ) ,
88+ weakRuntimeCheck : true
89+ } ) . apply ( compiler as any )
90+ }
8391 }
8492}
You can’t perform that action at this time.
0 commit comments