Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit774696c

Browse files
committed
fix: handle node_modules in standalone's dist dir
1 parent1a8230b commit774696c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

‎src/build/content/server.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,23 @@ export const copyNextServerCode = async (ctx: PluginContext): Promise<void> => {
146146
awaitcp(srcPath,destPath,{recursive:true,force:true})
147147
}),
148148
)
149+
150+
// this is different node_modules than one handled `copyNextDependencies`
151+
// this is under the standalone/.next folder (not standalone/node_modules)
152+
// and started to be created by Next.js in some cases in next@16.1.0-canary.3
153+
if(existsSync(join(srcDir,'node_modules'))){
154+
constfilter=ctx.constants.IS_LOCAL ?undefined :nodeModulesFilter
155+
constsrc=join(srcDir,'node_modules')
156+
constdest=join(destDir,'node_modules')
157+
awaitcp(src,dest,{
158+
recursive:true,
159+
verbatimSymlinks:true,
160+
force:true,
161+
filter,
162+
})
163+
164+
awaitrecreateNodeModuleSymlinks(ctx.resolveFromSiteDir('node_modules'),dest)
165+
}
149166
})
150167
}
151168

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp