You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building the chrome extension with svelte and webpack. Due to this i cannot use the webpack dev server where the HMR is working. The way how i need to work is the webpack --watch where HMR doesn't work.
The webpack does generate the hot-update files but they never get to the extension.
plugins: [newwebpack.DefinePlugin({'process.env': {EXTENSION_PREFIX: JSON.stringify(process.env.EXTENSION_PREFIX||EXT_NAME),NODE_ENV: JSON.stringify('production'),PORT_PREFIX: EXT_NAME,EXTENSION_VERSION: manifest.version}}),newwebpack.HotModuleReplacementPlugin(),
...
],module: {rules: {
...,{test: /\.svelte$/,use: {loader: 'svelte-loader',options: {compilerOptions: {dev: !isProduction,enableSourcemap: true},emitCss: isProduction,preprocess: svelteConfig.preprocess,hotReload: !isProduction,hotOptions: {// Prevent preserving local component statepreserveLocalState: false,// If this string appears anywhere in your component's code, then local// state won't be preserved, even when noPreserveState is falsenoPreserveStateKey: '@!hmr',// Prevent doing a full reload on next HMR update after fatal errornoReload: false,// Try to recover after runtime errors in component initoptimistic: true,// --- Advanced ---// Prevent adding an HMR accept handler to components with// accessors option to true, or to components with named exports// (from <script context="module">). This have the effect of// recreating the consumer of those components, instead of the// component themselves, on HMR updates. This might be needed to// reflect changes to accessors / named exports in the parents,// depending on how you use them.acceptAccessors: true,acceptNamedExports: true}}}},}}
Any help is appreciated.
The text was updated successfully, but these errors were encountered:
Hi,
I'm building the chrome extension with svelte and webpack. Due to this i cannot use the webpack dev server where the HMR is working. The way how i need to work is the
webpack --watch
where HMR doesn't work.The webpack does generate the
hot-update
files but they never get to the extension.Here is the sample from the generated js file
And the webpack configs rules look like this
Any help is appreciated.
The text was updated successfully, but these errors were encountered: