From 1da5040d60c7afd4da4646748ebfa3cf8d295507 Mon Sep 17 00:00:00 2001 From: YHH <359807859@qq.com> Date: Mon, 7 Jul 2025 11:06:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8C=85=E6=94=AF=E6=8C=81nodejs?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/build-rollup.js | 4 ++-- src/Utils/Snapshot/SnapshotExtension.ts | 2 +- src/Utils/Snapshot/index.ts | 2 +- src/index.ts | 5 ++++- 4 files changed, 8 insertions(+), 5 deletions(-) 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