mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-08-31 15:37:50 +00:00
fix: ensure safe removal of node_modules directory in build process
This commit is contained in:
parent
e719176b9c
commit
fd41247d37
1 changed files with 4 additions and 1 deletions
|
@ -55,7 +55,10 @@ for (const p of fs.readdirSync(tmpDistTemplatesPath)) {
|
|||
// Replace local template with remote schema
|
||||
patchManifestJsonSchema(pkgJsonPath)
|
||||
// remove node_modules
|
||||
fs.rmdirSync(path.join(distPath, "templates", p, "node_modules"), { recursive: true })
|
||||
const nodeModulesPath = path.join(distPath, "templates", p, "node_modules")
|
||||
if (fs.existsSync(nodeModulesPath)) {
|
||||
fs.rmdirSync(nodeModulesPath, { recursive: true })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue