Skip to content

Commit 8d10761

Browse files
committed
tmp: check which fixture hits recreateNodeModuleSymlinks case
1 parent ab01d87 commit 8d10761

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/build/content/server.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ export const copyNextServerCode = async (ctx: PluginContext): Promise<void> => {
191191
* @returns
192192
*/
193193
async function recreateNodeModuleSymlinks(src: string, dest: string, org?: string): Promise<void> {
194+
if (!org) {
195+
console.log('recreateNodeModuleSymlinks', { src, dest })
196+
}
197+
194198
const dirents = await readdir(join(src, org || ''), { withFileTypes: true })
195199

196200
await Promise.all(
@@ -207,14 +211,18 @@ async function recreateNodeModuleSymlinks(src: string, dest: string, org?: strin
207211
// the location where the symlink points to
208212
const symlinkTarget = await readlink(join(src, org || '', dirent.name))
209213
const symlinkDest = join(dest, org || '', symlinkTarget)
214+
215+
console.log({ symlinkSrc, symlinkTarget, symlinkDest })
210216
// only copy over symlinks that are traced through the nft bundle
211217
// and don't exist in the destination node_modules
212218
if (existsSync(symlinkDest) && !existsSync(symlinkSrc)) {
213219
if (org) {
214220
// if it is an organization folder let's create the folder first
215221
await mkdir(join(dest, org), { recursive: true })
216222
}
217-
await symlink(symlinkTarget, symlinkSrc)
223+
224+
// await symlink(symlinkTarget, symlinkSrc)
225+
throw new Error('(just for testing) hitting recreateNodeModuleSymlinks case')
218226
}
219227
}
220228
}),

0 commit comments

Comments
 (0)