Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/few-scissors-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/adapter-vercel': patch
---

Revert to cjs mode when building for lambda
8 changes: 4 additions & 4 deletions packages/adapter-vercel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ async function v1(builder, external) {
bundle: true,
platform: 'node',
external,
format: 'esm'
format: 'cjs'
});

writeFileSync(`${dirs.lambda}/package.json`, JSON.stringify({ type: 'module' }));
writeFileSync(`${dirs.lambda}/package.json`, JSON.stringify({ type: 'commonjs' }));

builder.log.minor('Copying assets...');

Expand Down Expand Up @@ -271,7 +271,7 @@ async function v3(builder, external, edge, split) {
target: `node${node_version.full}`,
bundle: true,
platform: 'node',
format: 'esm',
format: 'cjs',
external
});

Expand All @@ -284,7 +284,7 @@ async function v3(builder, external, edge, split) {
})
);

write(`${dirs.functions}/${name}.func/package.json`, JSON.stringify({ type: 'module' }));
write(`${dirs.functions}/${name}.func/package.json`, JSON.stringify({ type: 'commonjs' }));

routes.push({ src: pattern, dest: `/${name}` });
}
Expand Down