From 4064157195b0feb5319cdff90797660263417ced Mon Sep 17 00:00:00 2001 From: s1gr1d Date: Wed, 16 Oct 2024 14:59:58 +0200 Subject: [PATCH 1/4] test(nuxt): Use `sentry.server.config.ts` in E2E tests --- .../test-applications/nuxt-3/copyIITM.mjs | 52 +++++++++++++++++++ .../test-applications/nuxt-3/package.json | 5 +- ...ent.server.mjs => sentry.server.config.ts} | 0 .../test-applications/nuxt-4/copyIITM.mjs | 52 +++++++++++++++++++ .../test-applications/nuxt-4/package.json | 5 +- ...ent.server.mjs => sentry.server.config.ts} | 0 .../nuxt-4/tests/errors.client.test.ts | 2 +- .../nuxt-4/tests/tracing.client.test.ts | 2 +- 8 files changed, 114 insertions(+), 4 deletions(-) create mode 100644 dev-packages/e2e-tests/test-applications/nuxt-3/copyIITM.mjs rename dev-packages/e2e-tests/test-applications/nuxt-3/{public/instrument.server.mjs => sentry.server.config.ts} (100%) create mode 100644 dev-packages/e2e-tests/test-applications/nuxt-4/copyIITM.mjs rename dev-packages/e2e-tests/test-applications/nuxt-4/{public/instrument.server.mjs => sentry.server.config.ts} (100%) diff --git a/dev-packages/e2e-tests/test-applications/nuxt-3/copyIITM.mjs b/dev-packages/e2e-tests/test-applications/nuxt-3/copyIITM.mjs new file mode 100644 index 000000000000..d1c75e337710 --- /dev/null +++ b/dev-packages/e2e-tests/test-applications/nuxt-3/copyIITM.mjs @@ -0,0 +1,52 @@ +import fs from 'fs'; +import path from 'path'; + +/* This script copies the `import-in-the-middle` content of the E2E test project root `node_modules` to the build output `node_modules` + For some reason, some files are missing in the output (like `hook.mjs`) and this is not reproducible in external, standalone projects. + + Things we tried (that did not fix the problem): + - Adding a resolution for `@vercel/nft` v0.27.0 (this worked in the standalone project) + - Also adding `@vercel/nft` v0.27.0 to pnpm `peerDependencyRules` + */ +function copyFolderSync(src, dest) { + if (!fs.existsSync(dest)) { + fs.mkdirSync(dest, { recursive: true }); + } + + const entries = fs.readdirSync(src, { withFileTypes: true }); + + for (let entry of entries) { + const srcPath = path.join(src, entry.name); + const destPath = path.join(dest, entry.name); + + if (entry.isDirectory()) { + copyFolderSync(srcPath, destPath); + } else { + fs.copyFileSync(srcPath, destPath); + } + } +} + +function getSourceFolder() { + const specificVersionFolder = `node_modules${path.sep}.pnpm${path.sep}import-in-the-middle@1.11.2${path.sep}node_modules${path.sep}import-in-the-middle`; + + if (fs.existsSync(specificVersionFolder)) { + return specificVersionFolder; + } + + const parentFolder = `node_modules${path.sep}.pnpm`; + const folders = fs.readdirSync(parentFolder, { withFileTypes: true }); + + for (let folder of folders) { + if (folder.isDirectory() && folder.name.startsWith('import-in-the-middle@')) { + return path.join(parentFolder, folder.name, 'node_modules', 'import-in-the-middle'); + } + } + + throw new Error('No suitable import-in-the-middle folder found'); +} + +const sourceFolder = getSourceFolder(); +const destinationFolder = `.output${path.sep}server${path.sep}node_modules${path.sep}import-in-the-middle`; + +copyFolderSync(sourceFolder, destinationFolder); diff --git a/dev-packages/e2e-tests/test-applications/nuxt-3/package.json b/dev-packages/e2e-tests/test-applications/nuxt-3/package.json index 7173aeaa4ce5..9c8990aad3ea 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-3/package.json +++ b/dev-packages/e2e-tests/test-applications/nuxt-3/package.json @@ -3,7 +3,7 @@ "private": true, "type": "module", "scripts": { - "build": "nuxt build", + "build": "nuxt build && node ./copyIITM.mjs", "dev": "nuxt dev", "generate": "nuxt generate", "preview": "NODE_OPTIONS='--import ./public/instrument.server.mjs' nuxt preview", @@ -20,5 +20,8 @@ "@nuxt/test-utils": "^3.14.1", "@playwright/test": "^1.44.1", "@sentry-internal/test-utils": "link:../../../test-utils" + }, + "overrides": { + "@vercel/nft": "0.27.4" } } diff --git a/dev-packages/e2e-tests/test-applications/nuxt-3/public/instrument.server.mjs b/dev-packages/e2e-tests/test-applications/nuxt-3/sentry.server.config.ts similarity index 100% rename from dev-packages/e2e-tests/test-applications/nuxt-3/public/instrument.server.mjs rename to dev-packages/e2e-tests/test-applications/nuxt-3/sentry.server.config.ts diff --git a/dev-packages/e2e-tests/test-applications/nuxt-4/copyIITM.mjs b/dev-packages/e2e-tests/test-applications/nuxt-4/copyIITM.mjs new file mode 100644 index 000000000000..d1c75e337710 --- /dev/null +++ b/dev-packages/e2e-tests/test-applications/nuxt-4/copyIITM.mjs @@ -0,0 +1,52 @@ +import fs from 'fs'; +import path from 'path'; + +/* This script copies the `import-in-the-middle` content of the E2E test project root `node_modules` to the build output `node_modules` + For some reason, some files are missing in the output (like `hook.mjs`) and this is not reproducible in external, standalone projects. + + Things we tried (that did not fix the problem): + - Adding a resolution for `@vercel/nft` v0.27.0 (this worked in the standalone project) + - Also adding `@vercel/nft` v0.27.0 to pnpm `peerDependencyRules` + */ +function copyFolderSync(src, dest) { + if (!fs.existsSync(dest)) { + fs.mkdirSync(dest, { recursive: true }); + } + + const entries = fs.readdirSync(src, { withFileTypes: true }); + + for (let entry of entries) { + const srcPath = path.join(src, entry.name); + const destPath = path.join(dest, entry.name); + + if (entry.isDirectory()) { + copyFolderSync(srcPath, destPath); + } else { + fs.copyFileSync(srcPath, destPath); + } + } +} + +function getSourceFolder() { + const specificVersionFolder = `node_modules${path.sep}.pnpm${path.sep}import-in-the-middle@1.11.2${path.sep}node_modules${path.sep}import-in-the-middle`; + + if (fs.existsSync(specificVersionFolder)) { + return specificVersionFolder; + } + + const parentFolder = `node_modules${path.sep}.pnpm`; + const folders = fs.readdirSync(parentFolder, { withFileTypes: true }); + + for (let folder of folders) { + if (folder.isDirectory() && folder.name.startsWith('import-in-the-middle@')) { + return path.join(parentFolder, folder.name, 'node_modules', 'import-in-the-middle'); + } + } + + throw new Error('No suitable import-in-the-middle folder found'); +} + +const sourceFolder = getSourceFolder(); +const destinationFolder = `.output${path.sep}server${path.sep}node_modules${path.sep}import-in-the-middle`; + +copyFolderSync(sourceFolder, destinationFolder); diff --git a/dev-packages/e2e-tests/test-applications/nuxt-4/package.json b/dev-packages/e2e-tests/test-applications/nuxt-4/package.json index 14e28d852c88..2e08f080838b 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-4/package.json +++ b/dev-packages/e2e-tests/test-applications/nuxt-4/package.json @@ -3,7 +3,7 @@ "private": true, "type": "module", "scripts": { - "build": "nuxt build", + "build": "nuxt build && node ./copyIITM.mjs", "dev": "nuxt dev", "generate": "nuxt generate", "preview": "NODE_OPTIONS='--import ./public/instrument.server.mjs' nuxt preview", @@ -20,5 +20,8 @@ "@nuxt/test-utils": "^3.14.2", "@playwright/test": "^1.44.1", "@sentry-internal/test-utils": "link:../../../test-utils" + }, + "overrides": { + "@vercel/nft": "0.27.4" } } diff --git a/dev-packages/e2e-tests/test-applications/nuxt-4/public/instrument.server.mjs b/dev-packages/e2e-tests/test-applications/nuxt-4/sentry.server.config.ts similarity index 100% rename from dev-packages/e2e-tests/test-applications/nuxt-4/public/instrument.server.mjs rename to dev-packages/e2e-tests/test-applications/nuxt-4/sentry.server.config.ts diff --git a/dev-packages/e2e-tests/test-applications/nuxt-4/tests/errors.client.test.ts b/dev-packages/e2e-tests/test-applications/nuxt-4/tests/errors.client.test.ts index 1177218aebec..c887e255fe57 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-4/tests/errors.client.test.ts +++ b/dev-packages/e2e-tests/test-applications/nuxt-4/tests/errors.client.test.ts @@ -1,4 +1,4 @@ -import { expect, test } from '@nuxt/test-utils/playwright'; +import { expect, test } from '@playwright/test'; import { waitForError } from '@sentry-internal/test-utils'; test.describe('client-side errors', async () => { diff --git a/dev-packages/e2e-tests/test-applications/nuxt-4/tests/tracing.client.test.ts b/dev-packages/e2e-tests/test-applications/nuxt-4/tests/tracing.client.test.ts index 871d8b19513c..9119e279e491 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-4/tests/tracing.client.test.ts +++ b/dev-packages/e2e-tests/test-applications/nuxt-4/tests/tracing.client.test.ts @@ -1,4 +1,4 @@ -import { expect, test } from '@nuxt/test-utils/playwright'; +import { expect, test } from '@playwright/test'; import { waitForTransaction } from '@sentry-internal/test-utils'; import type { Span } from '@sentry/nuxt'; From 08756c8c70985ce6a772b4c8a257313581648b9a Mon Sep 17 00:00:00 2001 From: s1gr1d Date: Wed, 16 Oct 2024 15:39:28 +0200 Subject: [PATCH 2/4] delete node_options --- dev-packages/e2e-tests/test-applications/nuxt-3/package.json | 2 +- dev-packages/e2e-tests/test-applications/nuxt-4/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev-packages/e2e-tests/test-applications/nuxt-3/package.json b/dev-packages/e2e-tests/test-applications/nuxt-3/package.json index 9c8990aad3ea..9cf76e03455b 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-3/package.json +++ b/dev-packages/e2e-tests/test-applications/nuxt-3/package.json @@ -6,7 +6,7 @@ "build": "nuxt build && node ./copyIITM.mjs", "dev": "nuxt dev", "generate": "nuxt generate", - "preview": "NODE_OPTIONS='--import ./public/instrument.server.mjs' nuxt preview", + "preview": "nuxt preview", "clean": "npx nuxi cleanup", "test": "playwright test", "test:build": "pnpm install && npx playwright install && pnpm build", diff --git a/dev-packages/e2e-tests/test-applications/nuxt-4/package.json b/dev-packages/e2e-tests/test-applications/nuxt-4/package.json index 2e08f080838b..bfcd772a2d85 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-4/package.json +++ b/dev-packages/e2e-tests/test-applications/nuxt-4/package.json @@ -6,7 +6,7 @@ "build": "nuxt build && node ./copyIITM.mjs", "dev": "nuxt dev", "generate": "nuxt generate", - "preview": "NODE_OPTIONS='--import ./public/instrument.server.mjs' nuxt preview", + "preview": "nuxt preview", "clean": "npx nuxi cleanup", "test": "playwright test", "test:build": "pnpm install && npx playwright install && pnpm build", From addd10037d08ccc12560a5aa93fb0119ca14304d Mon Sep 17 00:00:00 2001 From: s1gr1d Date: Wed, 16 Oct 2024 16:09:41 +0200 Subject: [PATCH 3/4] fingers crossed --- .../e2e-tests/test-applications/nuxt-3/nuxt.config.ts | 6 ++++++ .../e2e-tests/test-applications/nuxt-3/package.json | 1 + .../e2e-tests/test-applications/nuxt-3/playwright.config.ts | 2 +- .../e2e-tests/test-applications/nuxt-4/nuxt.config.ts | 6 ++++++ .../e2e-tests/test-applications/nuxt-4/package.json | 1 + .../e2e-tests/test-applications/nuxt-4/playwright.config.ts | 2 +- 6 files changed, 16 insertions(+), 2 deletions(-) diff --git a/dev-packages/e2e-tests/test-applications/nuxt-3/nuxt.config.ts b/dev-packages/e2e-tests/test-applications/nuxt-3/nuxt.config.ts index 0fcccd560af9..87e046ed39e9 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-3/nuxt.config.ts +++ b/dev-packages/e2e-tests/test-applications/nuxt-3/nuxt.config.ts @@ -11,4 +11,10 @@ export default defineNuxtConfig({ }, }, }, + nitro: { + rollupConfig: { + // @sentry/... is set external to prevent bundling all of Sentry into the `runtime.mjs` file in the build output + external: [/@sentry\/.*/], + }, + }, }); diff --git a/dev-packages/e2e-tests/test-applications/nuxt-3/package.json b/dev-packages/e2e-tests/test-applications/nuxt-3/package.json index 9cf76e03455b..410a01530b6e 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-3/package.json +++ b/dev-packages/e2e-tests/test-applications/nuxt-3/package.json @@ -7,6 +7,7 @@ "dev": "nuxt dev", "generate": "nuxt generate", "preview": "nuxt preview", + "start": "node --import ./.output/server/sentry.server.config.mjs .output/server/index.mjs", "clean": "npx nuxi cleanup", "test": "playwright test", "test:build": "pnpm install && npx playwright install && pnpm build", diff --git a/dev-packages/e2e-tests/test-applications/nuxt-3/playwright.config.ts b/dev-packages/e2e-tests/test-applications/nuxt-3/playwright.config.ts index d1094993131d..aa1ff8e9743c 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-3/playwright.config.ts +++ b/dev-packages/e2e-tests/test-applications/nuxt-3/playwright.config.ts @@ -12,7 +12,7 @@ const nuxtConfigOptions: ConfigOptions = { * Like this: import { expect, test } from '@nuxt/test-utils/playwright' */ const config = getPlaywrightConfig({ - startCommand: `pnpm preview`, + startCommand: `pnpm start`, use: { ...nuxtConfigOptions }, }); diff --git a/dev-packages/e2e-tests/test-applications/nuxt-4/nuxt.config.ts b/dev-packages/e2e-tests/test-applications/nuxt-4/nuxt.config.ts index 90f26a8ea6b6..c00ba0d5d9ed 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-4/nuxt.config.ts +++ b/dev-packages/e2e-tests/test-applications/nuxt-4/nuxt.config.ts @@ -13,4 +13,10 @@ export default defineNuxtConfig({ }, }, }, + nitro: { + rollupConfig: { + // @sentry/... is set external to prevent bundling all of Sentry into the `runtime.mjs` file in the build output + external: [/@sentry\/.*/], + }, + }, }); diff --git a/dev-packages/e2e-tests/test-applications/nuxt-4/package.json b/dev-packages/e2e-tests/test-applications/nuxt-4/package.json index bfcd772a2d85..2dac1b6af20f 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-4/package.json +++ b/dev-packages/e2e-tests/test-applications/nuxt-4/package.json @@ -7,6 +7,7 @@ "dev": "nuxt dev", "generate": "nuxt generate", "preview": "nuxt preview", + "start": "node --import ./.output/server/sentry.server.config.mjs .output/server/index.mjs", "clean": "npx nuxi cleanup", "test": "playwright test", "test:build": "pnpm install && npx playwright install && pnpm build", diff --git a/dev-packages/e2e-tests/test-applications/nuxt-4/playwright.config.ts b/dev-packages/e2e-tests/test-applications/nuxt-4/playwright.config.ts index d1094993131d..aa1ff8e9743c 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-4/playwright.config.ts +++ b/dev-packages/e2e-tests/test-applications/nuxt-4/playwright.config.ts @@ -12,7 +12,7 @@ const nuxtConfigOptions: ConfigOptions = { * Like this: import { expect, test } from '@nuxt/test-utils/playwright' */ const config = getPlaywrightConfig({ - startCommand: `pnpm preview`, + startCommand: `pnpm start`, use: { ...nuxtConfigOptions }, }); From 622551f6472c1b10f3818269b478330674abb9b7 Mon Sep 17 00:00:00 2001 From: s1gr1d Date: Wed, 16 Oct 2024 16:37:27 +0200 Subject: [PATCH 4/4] use bash script --- .../test-applications/nuxt-3/copyIITM.bash | 7 +++ .../test-applications/nuxt-3/copyIITM.mjs | 52 ------------------- .../test-applications/nuxt-3/package.json | 2 +- .../test-applications/nuxt-4/copyIITM.bash | 7 +++ .../test-applications/nuxt-4/copyIITM.mjs | 52 ------------------- .../test-applications/nuxt-4/package.json | 2 +- 6 files changed, 16 insertions(+), 106 deletions(-) create mode 100644 dev-packages/e2e-tests/test-applications/nuxt-3/copyIITM.bash delete mode 100644 dev-packages/e2e-tests/test-applications/nuxt-3/copyIITM.mjs create mode 100644 dev-packages/e2e-tests/test-applications/nuxt-4/copyIITM.bash delete mode 100644 dev-packages/e2e-tests/test-applications/nuxt-4/copyIITM.mjs diff --git a/dev-packages/e2e-tests/test-applications/nuxt-3/copyIITM.bash b/dev-packages/e2e-tests/test-applications/nuxt-3/copyIITM.bash new file mode 100644 index 000000000000..0e04d001c968 --- /dev/null +++ b/dev-packages/e2e-tests/test-applications/nuxt-3/copyIITM.bash @@ -0,0 +1,7 @@ +# This script copies the `import-in-the-middle` content of the E2E test project root `node_modules` to the build output `node_modules` +# For some reason, some files are missing in the output (like `hook.mjs`) and this is not reproducible in external, standalone projects. +# +# Things we tried (that did not fix the problem): +# - Adding a resolution for `@vercel/nft` v0.27.0 (this worked in the standalone project) +# - Also adding `@vercel/nft` v0.27.0 to pnpm `peerDependencyRules` +cp -r node_modules/.pnpm/import-in-the-middle@1.*/node_modules/import-in-the-middle .output/server/node_modules/import-in-the-middle diff --git a/dev-packages/e2e-tests/test-applications/nuxt-3/copyIITM.mjs b/dev-packages/e2e-tests/test-applications/nuxt-3/copyIITM.mjs deleted file mode 100644 index d1c75e337710..000000000000 --- a/dev-packages/e2e-tests/test-applications/nuxt-3/copyIITM.mjs +++ /dev/null @@ -1,52 +0,0 @@ -import fs from 'fs'; -import path from 'path'; - -/* This script copies the `import-in-the-middle` content of the E2E test project root `node_modules` to the build output `node_modules` - For some reason, some files are missing in the output (like `hook.mjs`) and this is not reproducible in external, standalone projects. - - Things we tried (that did not fix the problem): - - Adding a resolution for `@vercel/nft` v0.27.0 (this worked in the standalone project) - - Also adding `@vercel/nft` v0.27.0 to pnpm `peerDependencyRules` - */ -function copyFolderSync(src, dest) { - if (!fs.existsSync(dest)) { - fs.mkdirSync(dest, { recursive: true }); - } - - const entries = fs.readdirSync(src, { withFileTypes: true }); - - for (let entry of entries) { - const srcPath = path.join(src, entry.name); - const destPath = path.join(dest, entry.name); - - if (entry.isDirectory()) { - copyFolderSync(srcPath, destPath); - } else { - fs.copyFileSync(srcPath, destPath); - } - } -} - -function getSourceFolder() { - const specificVersionFolder = `node_modules${path.sep}.pnpm${path.sep}import-in-the-middle@1.11.2${path.sep}node_modules${path.sep}import-in-the-middle`; - - if (fs.existsSync(specificVersionFolder)) { - return specificVersionFolder; - } - - const parentFolder = `node_modules${path.sep}.pnpm`; - const folders = fs.readdirSync(parentFolder, { withFileTypes: true }); - - for (let folder of folders) { - if (folder.isDirectory() && folder.name.startsWith('import-in-the-middle@')) { - return path.join(parentFolder, folder.name, 'node_modules', 'import-in-the-middle'); - } - } - - throw new Error('No suitable import-in-the-middle folder found'); -} - -const sourceFolder = getSourceFolder(); -const destinationFolder = `.output${path.sep}server${path.sep}node_modules${path.sep}import-in-the-middle`; - -copyFolderSync(sourceFolder, destinationFolder); diff --git a/dev-packages/e2e-tests/test-applications/nuxt-3/package.json b/dev-packages/e2e-tests/test-applications/nuxt-3/package.json index 410a01530b6e..079beb8bfc86 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-3/package.json +++ b/dev-packages/e2e-tests/test-applications/nuxt-3/package.json @@ -3,7 +3,7 @@ "private": true, "type": "module", "scripts": { - "build": "nuxt build && node ./copyIITM.mjs", + "build": "nuxt build && bash ./copyIITM.bash", "dev": "nuxt dev", "generate": "nuxt generate", "preview": "nuxt preview", diff --git a/dev-packages/e2e-tests/test-applications/nuxt-4/copyIITM.bash b/dev-packages/e2e-tests/test-applications/nuxt-4/copyIITM.bash new file mode 100644 index 000000000000..0e04d001c968 --- /dev/null +++ b/dev-packages/e2e-tests/test-applications/nuxt-4/copyIITM.bash @@ -0,0 +1,7 @@ +# This script copies the `import-in-the-middle` content of the E2E test project root `node_modules` to the build output `node_modules` +# For some reason, some files are missing in the output (like `hook.mjs`) and this is not reproducible in external, standalone projects. +# +# Things we tried (that did not fix the problem): +# - Adding a resolution for `@vercel/nft` v0.27.0 (this worked in the standalone project) +# - Also adding `@vercel/nft` v0.27.0 to pnpm `peerDependencyRules` +cp -r node_modules/.pnpm/import-in-the-middle@1.*/node_modules/import-in-the-middle .output/server/node_modules/import-in-the-middle diff --git a/dev-packages/e2e-tests/test-applications/nuxt-4/copyIITM.mjs b/dev-packages/e2e-tests/test-applications/nuxt-4/copyIITM.mjs deleted file mode 100644 index d1c75e337710..000000000000 --- a/dev-packages/e2e-tests/test-applications/nuxt-4/copyIITM.mjs +++ /dev/null @@ -1,52 +0,0 @@ -import fs from 'fs'; -import path from 'path'; - -/* This script copies the `import-in-the-middle` content of the E2E test project root `node_modules` to the build output `node_modules` - For some reason, some files are missing in the output (like `hook.mjs`) and this is not reproducible in external, standalone projects. - - Things we tried (that did not fix the problem): - - Adding a resolution for `@vercel/nft` v0.27.0 (this worked in the standalone project) - - Also adding `@vercel/nft` v0.27.0 to pnpm `peerDependencyRules` - */ -function copyFolderSync(src, dest) { - if (!fs.existsSync(dest)) { - fs.mkdirSync(dest, { recursive: true }); - } - - const entries = fs.readdirSync(src, { withFileTypes: true }); - - for (let entry of entries) { - const srcPath = path.join(src, entry.name); - const destPath = path.join(dest, entry.name); - - if (entry.isDirectory()) { - copyFolderSync(srcPath, destPath); - } else { - fs.copyFileSync(srcPath, destPath); - } - } -} - -function getSourceFolder() { - const specificVersionFolder = `node_modules${path.sep}.pnpm${path.sep}import-in-the-middle@1.11.2${path.sep}node_modules${path.sep}import-in-the-middle`; - - if (fs.existsSync(specificVersionFolder)) { - return specificVersionFolder; - } - - const parentFolder = `node_modules${path.sep}.pnpm`; - const folders = fs.readdirSync(parentFolder, { withFileTypes: true }); - - for (let folder of folders) { - if (folder.isDirectory() && folder.name.startsWith('import-in-the-middle@')) { - return path.join(parentFolder, folder.name, 'node_modules', 'import-in-the-middle'); - } - } - - throw new Error('No suitable import-in-the-middle folder found'); -} - -const sourceFolder = getSourceFolder(); -const destinationFolder = `.output${path.sep}server${path.sep}node_modules${path.sep}import-in-the-middle`; - -copyFolderSync(sourceFolder, destinationFolder); diff --git a/dev-packages/e2e-tests/test-applications/nuxt-4/package.json b/dev-packages/e2e-tests/test-applications/nuxt-4/package.json index 2dac1b6af20f..5e7bcd57af0e 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-4/package.json +++ b/dev-packages/e2e-tests/test-applications/nuxt-4/package.json @@ -3,7 +3,7 @@ "private": true, "type": "module", "scripts": { - "build": "nuxt build && node ./copyIITM.mjs", + "build": "nuxt build && bash ./copyIITM.bash", "dev": "nuxt dev", "generate": "nuxt generate", "preview": "nuxt preview",