diff --git a/packages/build/tests/edge_functions/snapshots/tests.js.md b/packages/build/tests/edge_functions/snapshots/tests.js.md index dd91154bf1..71bc248dd0 100644 --- a/packages/build/tests/edge_functions/snapshots/tests.js.md +++ b/packages/build/tests/edge_functions/snapshots/tests.js.md @@ -1,4 +1,4 @@ -# Snapshot report for `packages/build/tests/edge_functions/tests.js` +# Snapshot report for `tests/edge_functions/tests.js` The actual snapshot is saved in `tests.js.snap`. @@ -1279,7 +1279,7 @@ Generated by [AVA](https://avajs.dev). ────────────────────────────────────────────────────────────────␊ ␊ Error message␊ - Error: Command failed with exit code 1: deno bundle --import-map BASE64_STRING --quiet --code-splitting --allow-import --outdir /external/path packages/build/tests/edge_functions/fixtures/functions_invalid/netlify/edge-functions/functions-1.ts␊ + Error: Command failed with exit code 1: deno bundle --import-map BASE64_STRING --quiet --code-splitting --allow-import --node-modules-dir=manual --outdir /external/path packages/build/tests/edge_functions/fixtures/functions_invalid/netlify/edge-functions/functions-1.ts␊ STACK TRACE␊ ␊ export async () => ␊ @@ -1292,9 +1292,9 @@ Generated by [AVA](https://avajs.dev). ␊ Error properties␊ {␊ - shortMessage: 'Command failed with exit code 1: deno bundle --import-map BASE64_STRING --quiet --code-splitting --allow-import --outdir /external/path packages/build/tests/edge_functions/fixtures/functions_invalid/netlify/edge-functions/functions-1.ts',␊ - command: 'deno bundle --import-map BASE64_STRING --quiet --code-splitting --allow-import --outdir /external/path packages/build/tests/edge_functions/fixtures/functions_invalid/netlify/edge-functions/functions-1.ts',␊ - escapedCommand: 'deno bundle --import-map "BASE64_STRING" --quiet --code-splitting --allow-import --outdir "/external/path" "packages/build/tests/edge_functions/fixtures/functions_invalid/netlify/edge-functions/functions-1.ts"',␊ + shortMessage: 'Command failed with exit code 1: deno bundle --import-map BASE64_STRING --quiet --code-splitting --allow-import --node-modules-dir=manual --outdir /external/path packages/build/tests/edge_functions/fixtures/functions_invalid/netlify/edge-functions/functions-1.ts',␊ + command: 'deno bundle --import-map BASE64_STRING --quiet --code-splitting --allow-import --node-modules-dir=manual --outdir /external/path packages/build/tests/edge_functions/fixtures/functions_invalid/netlify/edge-functions/functions-1.ts',␊ + escapedCommand: 'deno bundle --import-map "BASE64_STRING" --quiet --code-splitting --allow-import "--node-modules-dir=manual" --outdir "/external/path" "packages/build/tests/edge_functions/fixtures/functions_invalid/netlify/edge-functions/functions-1.ts"',␊ exitCode: 1,␊ signal: undefined,␊ signalDescription: undefined,␊ diff --git a/packages/build/tests/edge_functions/snapshots/tests.js.snap b/packages/build/tests/edge_functions/snapshots/tests.js.snap index 0b79626884..3bd1091cef 100644 Binary files a/packages/build/tests/edge_functions/snapshots/tests.js.snap and b/packages/build/tests/edge_functions/snapshots/tests.js.snap differ diff --git a/packages/build/tests/install/snapshots/tests.js.md b/packages/build/tests/install/snapshots/tests.js.md index 5612a85c38..ceb36508bc 100644 --- a/packages/build/tests/install/snapshots/tests.js.md +++ b/packages/build/tests/install/snapshots/tests.js.md @@ -1159,70 +1159,3 @@ Generated by [AVA](https://avajs.dev). ␊ (Netlify Build completed in 1ms)␊ Build step duration: Netlify Build completed in 1ms` - -## In integration dev mode, install local plugins and install the integration when forcing build - -> Snapshot 1 - - `␊ - Netlify Build ␊ - ────────────────────────────────────────────────────────────────␊ - ␊ - > Version␊ - @netlify/build 1.0.0␊ - ␊ - > Flags␊ - context: dev␊ - debug: true␊ - repositoryRoot: packages/build/tests/install/fixtures/local_missing_integration␊ - testOpts:␊ - pluginsListUrl: test␊ - silentLingeringProcesses: true␊ - ␊ - > Current directory␊ - packages/build/tests/install/fixtures/local_missing_integration␊ - ␊ - > Config file␊ - packages/build/tests/install/fixtures/local_missing_integration/netlify.toml␊ - ␊ - > Resolved config␊ - build:␊ - publish: packages/build/tests/install/fixtures/local_missing_integration␊ - publishOrigin: default␊ - ␊ - > Context␊ - dev␊ - ␊ - > Installing extensions␊ - - functions-injection␊ - ␊ - > Loading extensions␊ - - functions-injection␊ - ␊ - functions-injection-buildhooks (onPreBuild event) ␊ - ────────────────────────────────────────────────────────────────␊ - ␊ - Hello from onPreBuild␊ - ␊ - (functions-injection-buildhooks onPreBuild completed in 1ms)␊ - Build step duration: functions-injection-buildhooks onPreBuild completed in 1ms␊ - ␊ - Functions bundling ␊ - ────────────────────────────────────────────────────────────────␊ - ␊ - Packaging Functions generated by functions-injection extension:␊ - - my_unique_prefix_2_function-with-external-dependencies-directory␊ - - my_unique_prefix_2_function-with-external-dependencies-directory-multifile␊ - - my_unique_prefix_2_function-with-external-dependencies.ts␊ - - my_unique_prefix_2_function-with-local-dependencies.ts␊ - - my_unique_prefix_2_function-with-no-dependencies.ts␊ - ␊ - ␊ - (Functions bundling completed in 1ms)␊ - Build step duration: Functions bundling completed in 1ms␊ - ␊ - Netlify Build Complete ␊ - ────────────────────────────────────────────────────────────────␊ - ␊ - (Netlify Build completed in 1ms)␊ - Build step duration: Netlify Build completed in 1ms` diff --git a/packages/build/tests/install/snapshots/tests.js.snap b/packages/build/tests/install/snapshots/tests.js.snap index 652d900c03..f205564e3d 100644 Binary files a/packages/build/tests/install/snapshots/tests.js.snap and b/packages/build/tests/install/snapshots/tests.js.snap differ diff --git a/packages/edge-bundler/node/bundler.ts b/packages/edge-bundler/node/bundler.ts index 49abb0175c..804fd182ba 100644 --- a/packages/edge-bundler/node/bundler.ts +++ b/packages/edge-bundler/node/bundler.ts @@ -123,6 +123,10 @@ export const bundle = async ( vendorDirectory, }) + if (vendor) { + importMap.add(vendor.importMap) + } + const bundles: Bundle[] = [] if (featureFlags.edge_bundler_generate_tarball || featureFlags.edge_bundler_dry_run_generate_tarball) { @@ -156,10 +160,6 @@ export const bundle = async ( } } - if (vendor) { - importMap.add(vendor.importMap) - } - bundles.push( await bundleESZIP({ basePath, diff --git a/packages/edge-bundler/node/formats/tarball.ts b/packages/edge-bundler/node/formats/tarball.ts index e0e6ed6c68..155bda6f59 100644 --- a/packages/edge-bundler/node/formats/tarball.ts +++ b/packages/edge-bundler/node/formats/tarball.ts @@ -88,6 +88,7 @@ export const bundle = async ({ '--quiet', '--code-splitting', '--allow-import', + '--node-modules-dir=manual', '--outdir', bundleDir.path, ...functions.map((func) => func.path),