fix: HRM in dev

This commit is contained in:
jialin
2026-05-12 14:31:52 +08:00
committed by jialin
parent 5ef671f047
commit 2527555945
5 changed files with 21 additions and 22 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
import { defineConfig } from '@umijs/max';
import keepAlive from './keep-alive';
import { extraMfsuExclude } from './mfsu.extensions';
import { compressionPluginConfig, monacoPluginConfig } from './plugins';
import proxy from './proxy';
import routes from './routes';
@@ -32,7 +33,7 @@ export default defineConfig({
defaultSizes: 'parsed' // stat // gzip
},
mfsu: {
exclude: ['lodash', 'ml-pca']
exclude: ['lodash', 'ml-pca', ...extraMfsuExclude]
},
base: process.env.npm_config_base || '/',
...(isProduction
+9
View File
@@ -0,0 +1,9 @@
// Identity hook for build-time mfsu.exclude extensions. Tooling may
// overwrite this file to add package names that must skip MFSU's
// pre-bundling; the original is restored on cleanup. Mirrors
// `src/request.extensions.ts` / `src/access.extensions.ts`.
//
// MFSU bundles node_modules into immutable chunks at dev startup, so
// workspace-linked packages whose source you edit during dev must be
// excluded here or HMR won't pick up changes.
export const extraMfsuExclude: string[] = [];