diff --git a/packages/next-swc/crates/core/tests/fixture/next-dynamic/issue-48098/output-dev.js b/packages/next-swc/crates/core/tests/fixture/next-dynamic/issue-48098/output-dev.js new file mode 100644 index 0000000000000..80026d8666766 --- /dev/null +++ b/packages/next-swc/crates/core/tests/fixture/next-dynamic/issue-48098/output-dev.js @@ -0,0 +1,9 @@ +import dynamic from 'next/dynamic'; +export const NextDynamicNoSSRServerComponent = dynamic(()=>import('../text-dynamic-no-ssr-server'), { + loadableGenerated: { + modules: [ + "some-file.js -> " + "../text-dynamic-no-ssr-server" + ] + }, + ssr: false +}); diff --git a/packages/next-swc/crates/core/tests/fixture/next-dynamic/issue-48098/output-prod.js b/packages/next-swc/crates/core/tests/fixture/next-dynamic/issue-48098/output-prod.js new file mode 100644 index 0000000000000..f8c4bc1b8a60c --- /dev/null +++ b/packages/next-swc/crates/core/tests/fixture/next-dynamic/issue-48098/output-prod.js @@ -0,0 +1,9 @@ +import dynamic from 'next/dynamic'; +export const NextDynamicNoSSRServerComponent = dynamic(()=>import('../text-dynamic-no-ssr-server'), { + loadableGenerated: { + webpack: ()=>[ + require.resolveWeak("../text-dynamic-no-ssr-server") + ] + }, + ssr: false +}); diff --git a/packages/next-swc/crates/core/tests/fixture/next-dynamic/issue-48098/output-server.js b/packages/next-swc/crates/core/tests/fixture/next-dynamic/issue-48098/output-server.js new file mode 100644 index 0000000000000..2954baa41658f --- /dev/null +++ b/packages/next-swc/crates/core/tests/fixture/next-dynamic/issue-48098/output-server.js @@ -0,0 +1,9 @@ +import dynamic from 'next/dynamic'; +export const NextDynamicNoSSRServerComponent = dynamic(null, { + loadableGenerated: { + modules: [ + "some-file.js -> " + "../text-dynamic-no-ssr-server" + ] + }, + ssr: false +});