@xunlei-open/vite-plugin-miniapp 0.1.1-beta.1 → 0.1.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +4 -10
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # @xunlei-open/vite-plugin-miniapp
2
2
 
3
- 将微应用页面和生命周期事件构建为宿主可安装的 `dist` 目录。
3
+ 迅雷微应用的底层 Vite 构建插件,处理应用清单、图标和事件脚本。一般项目使用 [@xunlei-open/miniapp](https://github.com/xunlei-open/miniapp-devkit/tree/main/packages/miniapp) 即可。
4
4
 
5
- 普通微应用项目建议直接使用 `@xunlei-open/miniapp` 统一运行开发、构建和打包命令。本包是底层 Vite 集成层,适合开发工具内部使用或需要直接控制 Vite 的高级场景。
5
+ 需要直接接入 Vite 时:
6
6
 
7
7
  ```bash
8
8
  pnpm add -D @xunlei-open/vite-plugin-miniapp vite
@@ -17,12 +17,6 @@ export default defineConfig({
17
17
  })
18
18
  ```
19
19
 
20
- 插件默认读取根目录的 `manifest.json`,并将 manifest 及其 `icon` 文件复制到 `dist`。项目不需要创建事件目录;如果存在 `src/events/*.{ts,js}`,插件会自动把它们构建到 `dist/events`。
20
+ 默认读取 `manifest.json`,将清单和图标复制到构建目录,并将 `src/events` 中的事件脚本构建到 `events/`。没有事件脚本时无需创建该目录。
21
21
 
22
- ```ts
23
- miniapp({
24
- eventsDir: 'src/events',
25
- eventsExtensions: ['.ts', '.js'],
26
- manifestFile: 'manifest.json',
27
- })
28
- ```
22
+ [官方开发文档](https://open.xunlei.com/doc/miniapp/introduction)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xunlei-open/vite-plugin-miniapp",
3
- "version": "0.1.1-beta.1",
3
+ "version": "0.1.1-beta.2",
4
4
  "description": "Vite plugin for building Xunlei Miniapps",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",