fix entry shit in build for client
This commit is contained in:
@@ -98,7 +98,8 @@ async function buildBundle(config: BundleConfig): Promise<void> {
|
|||||||
entryPath = path.join(srcDir, config.entry)
|
entryPath = path.join(srcDir, config.entry)
|
||||||
} else {
|
} else {
|
||||||
// Create temporary entry file for wrapper bundles
|
// Create temporary entry file for wrapper bundles
|
||||||
entryPath = path.join(distDir, `_${config.name}-entry.js`)
|
const entrySuffix = `${process.pid}-${Date.now()}`
|
||||||
|
entryPath = path.join(distDir, `_${config.name}-entry-${entrySuffix}.js`)
|
||||||
fs.writeFileSync(entryPath, config.code)
|
fs.writeFileSync(entryPath, config.code)
|
||||||
cleanupEntry = true
|
cleanupEntry = true
|
||||||
}
|
}
|
||||||
@@ -113,7 +114,7 @@ async function buildBundle(config: BundleConfig): Promise<void> {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Cleanup temporary entry file
|
// Cleanup temporary entry file
|
||||||
if (cleanupEntry) {
|
if (cleanupEntry && fs.existsSync(entryPath)) {
|
||||||
fs.unlinkSync(entryPath)
|
fs.unlinkSync(entryPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user