构建cjs/mjs
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
2
thirdparty/BehaviourTree-ai
vendored
2
thirdparty/BehaviourTree-ai
vendored
Submodule thirdparty/BehaviourTree-ai updated: f3e91b9f34...4da406cf02
Reference in New Issue
Block a user