Skip to content

Commit 6f699e6

Browse files
committed
add some logging to try and figure out build failures
1 parent 253f509 commit 6f699e6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

packages/adapter-vercel/index.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,8 @@ async function v3(builder, external, edge, split) {
268268
await create_function_bundle(
269269
`${tmp}/index.js`,
270270
`${dirs.functions}/${name}.func`,
271-
`nodejs${node_version.major}.x`
271+
`nodejs${node_version.major}.x`,
272+
builder
272273
);
273274

274275
routes.push({ src: pattern, dest: `/${name}` });
@@ -402,11 +403,13 @@ function get_node_version() {
402403
* @param {string} entry
403404
* @param {string} dir
404405
* @param {string} runtime
406+
* @param {import('@sveltejs/kit').Builder} builder
405407
*/
406-
async function create_function_bundle(entry, dir, runtime) {
408+
async function create_function_bundle(entry, dir, runtime, builder) {
407409
let base = entry;
408410
while (base !== (base = path.dirname(base)));
409411

412+
builder.log.minor('Tracing dependencies...');
410413
const traced = await nodeFileTrace([entry], { base });
411414

412415
traced.warnings.forEach((error) => {
@@ -452,8 +455,11 @@ async function create_function_bundle(entry, dir, runtime) {
452455

453456
if (source !== realpath) {
454457
const realdest = path.join(dir, path.relative(ancestor, realpath));
455-
fs.symlinkSync(path.relative(path.dirname(dest), realdest), dest, is_dir ? 'dir' : 'file');
458+
const target = path.relative(path.dirname(dest), realdest);
459+
builder.log.minor(`Symlinking ${path.relative('.', dest)} to ${target}`);
460+
fs.symlinkSync(target, dest, is_dir ? 'dir' : 'file');
456461
} else if (!is_dir) {
462+
builder.log.minor(`Copying ${path.relative('.', source)} to ${path.relative('.', dest)}`);
457463
fs.copyFileSync(source, dest);
458464
}
459465
}

0 commit comments

Comments
 (0)