fix:doric-cli when in dev mode,build bundle cause conflict
This commit is contained in:
parent
bdd392e455
commit
4e5b1c94bf
@ -60,6 +60,13 @@ async function doMerge(jsFile: string) {
|
||||
|
||||
|
||||
export async function mergeMap(mapFile: string) {
|
||||
const lockFile = `${mapFile}.lock`;
|
||||
if (fs.existsSync(lockFile)) {
|
||||
console.log("In mergeMap,skip")
|
||||
return;
|
||||
}
|
||||
await fs.promises.writeFile(lockFile, (new Date).toString(), "utf-8")
|
||||
try {
|
||||
const buildMap = mapFile.replace(/bundle\//, 'build/')
|
||||
if (fs.existsSync(buildMap)) {
|
||||
const mergedMap = createMergedSourceMapFromFiles([
|
||||
@ -68,4 +75,8 @@ export async function mergeMap(mapFile: string) {
|
||||
], true);
|
||||
await fs.promises.writeFile(mapFile, mergedMap);
|
||||
}
|
||||
} finally {
|
||||
await fs.promises.unlink(lockFile)
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user