feat: Optimize bundling to remove shipping package.json inside mermaid's JS bundle.

Move all build time injected variables to `injected.` namespace to avoid conflicts.
This commit is contained in:
Sidharth Vinod
2025-11-04 23:49:54 +07:00
parent 287a9a3fcb
commit b76ccae065
10 changed files with 20 additions and 19 deletions

View File

@@ -78,6 +78,8 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
},
define: {
'import.meta.vitest': 'undefined',
'injected.includeLargeFeatures': 'true',
'injected.version': `'0.0.0'`,
},
resolve: {
extensions: [],
@@ -94,10 +96,6 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
}),
...visualizerOptions(packageName, core),
],
define: {
// Needs to be string
includeLargeFeatures: 'true',
},
};
if (watch && config.build) {