@orielweb/api 0.4.15 → 0.5.0
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.
- package/README.md +7 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -98,12 +98,16 @@ const un = await win.onCloseRequested(async () => {
|
|
|
98
98
|
|
|
99
99
|
## 怎么把它引进页面
|
|
100
100
|
|
|
101
|
-
包**没有打包器依赖**,`exports` 直接指向 `src/*.js
|
|
101
|
+
包**没有打包器依赖**,`exports` 直接指向 `src/*.js`。三条路:
|
|
102
|
+
|
|
103
|
+
```sh
|
|
104
|
+
npm install @orielweb/api
|
|
105
|
+
```
|
|
102
106
|
|
|
103
107
|
| 场景 | 做法 |
|
|
104
108
|
|---|---|
|
|
105
|
-
| 有打包器(Vite / esbuild / …) | `import { invoke } from '@orielweb/api/core'` ——
|
|
106
|
-
| 没有打包器(内嵌静态页) | 两种:配一个 import map
|
|
109
|
+
| 有打包器(Vite / esbuild / …) | `import { invoke } from '@orielweb/api/core'` —— 裸标识符由打包器解析,无需额外配置 |
|
|
110
|
+
| 没有打包器(内嵌静态页) | 两种:配一个 import map(映射到 `node_modules/@orielweb/api/src/*.js`);或把 `src/*.js` 拷进产物后走相对路径 `./vendor/orielweb-api/core.js` |
|
|
107
111
|
|
|
108
112
|
`samples/OrielDemo` 走的是第二条路的相对路径形式(它要把包源码内嵌进程序集,
|
|
109
113
|
见 `OrielDemo.csproj` 的 vendor 段落——**直接内嵌源码而不是复制一份**,所以不存在副本漂移):
|