From bce4a2619781fedea22782025c14006caeef199f Mon Sep 17 00:00:00 2001 From: YHH <359807859@qq.com> Date: Mon, 7 Jul 2025 11:49:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9E=84=E5=BB=BAcjs/mjs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rollup.config.js | 9 ++++----- scripts/build-rollup.js | 18 +++++++++--------- thirdparty/BehaviourTree-ai | 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index afc93960..665214bc 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -31,7 +31,7 @@ module.exports = [ { input: 'bin/index.js', output: { - file: 'dist/index.js', + file: 'dist/index.mjs', format: 'es', banner, sourcemap: true, @@ -53,13 +53,12 @@ module.exports = [ } }, - // UMD构建(可选) + // CommonJS构建 { input: 'bin/index.js', output: { - file: 'dist/index.umd.js', - format: 'umd', - name: 'ECSFramework', + file: 'dist/index.cjs', + format: 'cjs', banner, sourcemap: true, exports: 'named' diff --git a/scripts/build-rollup.js b/scripts/build-rollup.js index 7c2e89a4..242cb737 100644 --- a/scripts/build-rollup.js +++ b/scripts/build-rollup.js @@ -44,21 +44,21 @@ function generatePackageJson() { name: sourcePackage.name, version: sourcePackage.version, description: sourcePackage.description, - main: 'index.umd.js', - module: 'index.js', + main: 'index.cjs', + module: 'index.mjs', types: 'index.d.ts', exports: { '.': { - import: './index.js', - require: './index.umd.js', + import: './index.mjs', + require: './index.cjs', types: './index.d.ts' } }, files: [ - 'index.js', - 'index.js.map', - 'index.umd.js', - 'index.umd.js.map', + 'index.mjs', + 'index.mjs.map', + 'index.cjs', + 'index.cjs.map', 'index.d.ts', 'README.md', 'LICENSE', @@ -110,7 +110,7 @@ function copyFiles() { function showBuildResults() { const distDir = './dist'; - const files = ['index.js', 'index.umd.js', 'index.d.ts']; + const files = ['index.mjs', 'index.cjs', 'index.d.ts']; console.log('\n📊 构建结果:'); files.forEach(file => { diff --git a/thirdparty/BehaviourTree-ai b/thirdparty/BehaviourTree-ai index f3e91b9f..4da406cf 160000 --- a/thirdparty/BehaviourTree-ai +++ b/thirdparty/BehaviourTree-ai @@ -1 +1 @@ -Subproject commit f3e91b9f34eaa41d38a5a284be01597e0376c3b3 +Subproject commit 4da406cf0263027abffbf184cc9347c04ca67dbe