From 02eb2de441916c108d7cb96e572769f717c4647a Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 22 Feb 2024 15:34:20 +0800 Subject: [PATCH] __before_bundle directory should be inside the engine folder. (#57) * 2.2.5 * __before_bundle directory should be inside the engine folder. Otherwise, dragonbones library will not be found, the bundled .d.ts file will not contain dragonbones librarys, there will be lots of 'codec' type. * Add utility function: path.basename. --- modules/dts-bundler/src/index.ts | 2 +- modules/utils/src/path.ts | 4 ++++ package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/dts-bundler/src/index.ts b/modules/dts-bundler/src/index.ts index e3a5fd7..4f03c56 100644 --- a/modules/dts-bundler/src/index.ts +++ b/modules/dts-bundler/src/index.ts @@ -48,7 +48,7 @@ export async function build (options: Options): Promise { const tsConfigPath = statsQuery.tsConfigPath; - const unbundledOutDir = ps.join(outDir, '__before_bundle'); + const unbundledOutDir = ps.join(engine, '__dts_before_bundle'); const parsedCommandLine = ts.getParsedCommandLineOfConfigFile( tsConfigPath, { declaration: true, diff --git a/modules/utils/src/path.ts b/modules/utils/src/path.ts index cadd834..1eb3cb1 100644 --- a/modules/utils/src/path.ts +++ b/modules/utils/src/path.ts @@ -11,6 +11,10 @@ export function dirname (path: string): string { return formatPath(ps.dirname(path)); } +export function basename (path: string): string { + return formatPath(ps.basename(path)); +} + export function join (...args: string[]): string { return formatPath(ps.join(...args)); } diff --git a/package-lock.json b/package-lock.json index c98a2d4..7e4d9fb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@cocos/ccbuild", - "version": "2.2.4", + "version": "2.2.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@cocos/ccbuild", - "version": "2.2.4", + "version": "2.2.5", "hasInstallScript": true, "license": "MIT", "workspaces": [ diff --git a/package.json b/package.json index e819e99..6ddd4a0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cocos/ccbuild", - "version": "2.2.4", + "version": "2.2.5", "description": "The next generation of build tool for Cocos engine.", "main": "./lib/index.js", "types": "./lib/index.d.ts",