打包支持nodejs模块

This commit is contained in:
YHH
2025-07-07 11:06:08 +08:00
parent afd33e053b
commit 1da5040d60
4 changed files with 8 additions and 5 deletions

View File

@@ -44,13 +44,13 @@ function generatePackageJson() {
name: sourcePackage.name,
version: sourcePackage.version,
description: sourcePackage.description,
main: 'index.js',
main: 'index.umd.js',
module: 'index.js',
types: 'index.d.ts',
type: 'module',
exports: {
'.': {
import: './index.js',
require: './index.umd.js',
types: './index.d.ts'
}
},

View File

@@ -55,7 +55,7 @@ export function Serializable(config?: Partial<SnapshotConfig>) {
*
* 用于配置组件的快照行为
*/
export function SnapshotConfig(config: SnapshotConfig) {
export function SnapshotConfigDecorator(config: SnapshotConfig) {
return function (target: any) {
target.prototype.snapshotConfig = config;
};

View File

@@ -14,6 +14,6 @@ export { SnapshotManager } from './SnapshotManager';
export {
ISnapshotExtension,
Serializable,
SnapshotConfig as SnapshotConfigDecorator,
SnapshotConfigDecorator,
SnapshotExtension
} from './SnapshotExtension';

View File

@@ -19,3 +19,6 @@ export * from './ECS';
// 工具类和类型定义
export * from './Utils';
export * from './Types';
// 快照系统(可选模块)
export * from './Utils/Snapshot';