Fix: build async bug
This commit is contained in:
		
							parent
							
								
									fdbf369454
								
							
						
					
					
						commit
						8bad0cffff
					
				
							
								
								
									
										6
									
								
								build.js
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								build.js
									
									
									
									
									
								
							@ -83,6 +83,7 @@ function dateFormat(fmt, date) {
 | 
				
			|||||||
  return fmt;
 | 
					  return fmt;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					async function main() {
 | 
				
			||||||
  const t = new Date();
 | 
					  const t = new Date();
 | 
				
			||||||
  const buildTime = dateFormat("YYYY-mm-dd HH:MM:SS", t);
 | 
					  const buildTime = dateFormat("YYYY-mm-dd HH:MM:SS", t);
 | 
				
			||||||
  const buildDir = "builds";
 | 
					  const buildDir = "builds";
 | 
				
			||||||
@ -95,7 +96,7 @@ clearFolder(buildDir);
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  copyFolderRecursiveSync("addon", buildDir);
 | 
					  copyFolderRecursiveSync("addon", buildDir);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
esbuild
 | 
					  await esbuild
 | 
				
			||||||
    .build({
 | 
					    .build({
 | 
				
			||||||
      entryPoints: ["src/index.ts"],
 | 
					      entryPoints: ["src/index.ts"],
 | 
				
			||||||
      bundle: true,
 | 
					      bundle: true,
 | 
				
			||||||
@ -169,3 +170,6 @@ console.log("[Build] Addon pack OK");
 | 
				
			|||||||
  console.log(
 | 
					  console.log(
 | 
				
			||||||
    `[Build] Finished in ${(new Date().getTime() - t.getTime()) / 1000} s.`
 | 
					    `[Build] Finished in ${(new Date().getTime() - t.getTime()) / 1000} s.`
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					main();
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user