@@ -3,7 +3,6 @@ import { existsSync as fsExistsSync } from "node:fs";
33import { mkdir as fsMkdir , readdir as fsReaddir , readFile as fsReadFile , rm as fsRm , writeFile as fsWriteFile } from "node:fs/promises" ;
44import { dirname as pathDirname , join as pathJoin } from "node:path" ;
55import { fileURLToPath } from "node:url" ;
6- import ncc from "@vercel/ncc" ;
76const root = pathDirname ( fileURLToPath ( import . meta. url ) ) ;
87const packageFileName = "package.json" ;
98const scriptEntryPointFileName = "main.js" ;
@@ -41,22 +40,9 @@ if (fsExistsSync(outputDirectoryPath)) {
4140
4241/* Create bundle. */
4342console . log ( execSync ( `"${ pathJoin ( root , "node_modules" , ".bin" , process . platform === "win32" ? "tsc.cmd" : "tsc" ) } " -p "${ pathJoin ( root , "tsconfig.json" ) } "` ) . toString ( "utf8" ) ) ;
44- let { code } = await ncc ( inputFilePath , {
45- assetBuilds : false ,
46- cache : false ,
47- debugLog : false ,
48- license : "" ,
49- minify : false ,
50- quiet : false ,
51- sourceMap : false ,
52- sourceMapRegister : false ,
53- target : "es2020" ,
54- v8cache : false ,
55- watch : false
56- } ) ;
57- await fsWriteFile ( outputFilePath , code , { encoding : "utf8" } ) ;
5843let packageMeta = JSON . parse ( await fsReadFile ( pathJoin ( root , packageFileName ) , { encoding : "utf8" } ) ) ;
5944delete packageMeta . scripts ;
6045delete packageMeta . dependencies ;
6146delete packageMeta . devDependencies ;
6247await fsWriteFile ( pathJoin ( outputDirectoryPath , packageFileName ) , `${ JSON . stringify ( packageMeta , undefined , "\t" ) } \n` , { encoding : "utf8" } ) ;
48+ console . log ( execSync ( `"${ pathJoin ( root , "node_modules" , ".bin" , process . platform === "win32" ? "webpack.cmd" : "webpack" ) } "` ) . toString ( "utf8" ) ) ;
0 commit comments