更新库rollup配置

This commit is contained in:
YHH
2025-08-11 10:25:28 +08:00
parent 6a49f6a534
commit 7daf352a25
11 changed files with 291 additions and 82 deletions

View File

@@ -82,6 +82,36 @@ module.exports = [
}
},
// UMD构建 - 用于CDN和浏览器直接使用
{
input: 'bin/index.js',
output: {
file: 'dist/index.umd.js',
format: 'umd',
name: 'ECSNetwork',
banner,
sourcemap: true,
exports: 'named',
globals: {
'@esengine/ecs-framework': 'ECS',
'protobufjs': 'protobuf',
'reflect-metadata': 'Reflect'
}
},
plugins: [
...commonPlugins,
terser({
format: {
comments: /^!/
}
})
],
external: ['@esengine/ecs-framework', 'protobufjs', 'reflect-metadata'],
treeshake: {
moduleSideEffects: false
}
},
// 类型定义构建
{
input: 'bin/index.d.ts',