diff --git a/.changeset/tired-knives-cross.md b/.changeset/tired-knives-cross.md new file mode 100644 index 0000000000..6ad526d095 --- /dev/null +++ b/.changeset/tired-knives-cross.md @@ -0,0 +1,5 @@ +--- +"@lynx-js/lynx-bundle-rslib-config": patch +--- + +Fix `globDynamicComponentEntry is not defined` error when minify is enabled in external bundle consumer. diff --git a/packages/rspeedy/lynx-bundle-rslib-config/src/webpack/MainThreadRuntimeWrapperWebpackPlugin.ts b/packages/rspeedy/lynx-bundle-rslib-config/src/webpack/MainThreadRuntimeWrapperWebpackPlugin.ts index ea1e5bd6cc..eb65daeee3 100644 --- a/packages/rspeedy/lynx-bundle-rslib-config/src/webpack/MainThreadRuntimeWrapperWebpackPlugin.ts +++ b/packages/rspeedy/lynx-bundle-rslib-config/src/webpack/MainThreadRuntimeWrapperWebpackPlugin.ts @@ -33,7 +33,9 @@ export class MainThreadRuntimeWrapperWebpackPlugin { new BannerPlugin({ test: this.options.test ?? /\.js$/, raw: true, - banner: `(function () { + banner: `(function () { + // TODO: remove this after \`useModuleWrapper\` supports MTS + var globDynamicComponentEntry = '__Card__'; const module = { exports: {} } const exports = module.exports`, }).apply(compiler)