fix: correct globals.d.ts reference path in build output
Some checks failed
armco-org/node-starter-kit/pipeline/head There was a failure building this commit
Some checks failed
armco-org/node-starter-kit/pipeline/head There was a failure building this commit
This commit is contained in:
13
build.ts
13
build.ts
@@ -103,6 +103,19 @@ import pkg from "./package.json";
|
||||
fs.copyFileSync("./v2/globals.d.ts", "./dist/globals.d.ts");
|
||||
}
|
||||
|
||||
// Fix globals.d.ts reference path in index.d.ts
|
||||
// TypeScript outputs "../v2/globals.d.ts" but we need "./globals.d.ts"
|
||||
logger.info('🔧 Fixing globals.d.ts reference path...');
|
||||
const indexDtsPath = "./dist/index.d.ts";
|
||||
if (fs.existsSync(indexDtsPath)) {
|
||||
let indexDts = fs.readFileSync(indexDtsPath, 'utf8');
|
||||
indexDts = indexDts.replace(
|
||||
/\/\/\/ <reference path="\.\.\/v2\/globals\.d\.ts" \/>/,
|
||||
'/// <reference path="./globals.d.ts" />'
|
||||
);
|
||||
fs.writeFileSync(indexDtsPath, indexDts);
|
||||
}
|
||||
|
||||
logger.info('✅ Build completed successfully!');
|
||||
logger.info('📦 Package ready in ./dist folder');
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user