diff --git a/scripts/build-rollup.js b/scripts/build-rollup.js index 8fdfbfbf..7c2e89a4 100644 --- a/scripts/build-rollup.js +++ b/scripts/build-rollup.js @@ -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' } }, diff --git a/src/Utils/Snapshot/SnapshotExtension.ts b/src/Utils/Snapshot/SnapshotExtension.ts index c3627200..fc8d8e16 100644 --- a/src/Utils/Snapshot/SnapshotExtension.ts +++ b/src/Utils/Snapshot/SnapshotExtension.ts @@ -55,7 +55,7 @@ export function Serializable(config?: Partial) { * * 用于配置组件的快照行为 */ -export function SnapshotConfig(config: SnapshotConfig) { +export function SnapshotConfigDecorator(config: SnapshotConfig) { return function (target: any) { target.prototype.snapshotConfig = config; }; diff --git a/src/Utils/Snapshot/index.ts b/src/Utils/Snapshot/index.ts index 5bf5ac05..ba239567 100644 --- a/src/Utils/Snapshot/index.ts +++ b/src/Utils/Snapshot/index.ts @@ -14,6 +14,6 @@ export { SnapshotManager } from './SnapshotManager'; export { ISnapshotExtension, Serializable, - SnapshotConfig as SnapshotConfigDecorator, + SnapshotConfigDecorator, SnapshotExtension } from './SnapshotExtension'; \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 9a2a357d..55da6d46 100644 --- a/src/index.ts +++ b/src/index.ts @@ -18,4 +18,7 @@ export * from './ECS'; // 工具类和类型定义 export * from './Utils'; -export * from './Types'; \ No newline at end of file +export * from './Types'; + +// 快照系统(可选模块) +export * from './Utils/Snapshot'; \ No newline at end of file