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