Skip to content

Commit 8e5a710

Browse files
committed
docs: update README to reflect changes in SnapDOM ESM build structure and usage instructions
1 parent cd740af commit 8e5a710

2 files changed

Lines changed: 5 additions & 31 deletions

File tree

README.md

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -146,31 +146,17 @@ yarn add @zumer/snapdom@dev
146146

147147
## Build Outputs & Tree-Shaking
148148

149-
SnapDOM ships multiple build variants, but using it is simple.
149+
SnapDOM ships two main variants:
150150

151-
### npm usage → ESM modular build (tree-shakeable)
151+
### npm usage → ESM build (tree-shakeable)
152152

153153
When you import SnapDOM in a project with a bundler:
154154

155155
```js
156156
import { snapdom } from '@zumer/snapdom';
157157
```
158158

159-
your environment automatically loads:
160-
161-
```sh
162-
dist/modules/snapdom.js
163-
```
164-
165-
This is the modular ESM build, enabling:
166-
167-
- Tree-shaking
168-
169-
- Code-splitting
170-
171-
- Lazy loading of exporters (toPng, toJpg, toWebp, etc.)
172-
173-
You do not need to configure anything; bundlers pick this build automatically.
159+
your environment loads `dist/snapdom.mjs`, a monolithic ESM build. Bundlers tree-shake unused code automatically.
174160

175161
### Script tag usage → Global build
176162

@@ -183,7 +169,7 @@ You do not need to configure anything; bundlers pick this build automatically.
183169
</script>
184170
```
185171

186-
This loads the monolithic global build and exposes snapdom on window.
172+
This loads the IIFE build and exposes snapdom on window.
187173

188174

189175
## Basic usage

README_CN.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -157,19 +157,7 @@ SnapDOM 提供多种构建版本,但使用方式非常简单。
157157
import { snapdom } from '@zumer/snapdom';
158158
```
159159

160-
打包工具会自动加载:
161-
162-
```
163-
dist/modules/snapdom.js
164-
```
165-
166-
这是 SnapDOM 的 **模块化 ESM 构建**,具有以下特性:
167-
168-
* 支持 Tree-Shaking(自动移除未使用代码)
169-
* 支持按需代码拆分
170-
* 内部导出函数(`toPng``toJpg``toWebp` 等)会 **懒加载**
171-
172-
无需额外配置,打包工具会自动选择此构建版本。
160+
打包工具会自动加载 `dist/snapdom.mjs`,这是 SnapDOM 的 **ESM 单文件构建**,支持 Tree-Shaking,打包工具会自动移除未使用代码。无需额外配置。
173161

174162
### 浏览器直接使用 `<script>`**全局 IIFE 构建**
175163

0 commit comments

Comments
 (0)