@tomjs/vite-plugin-electron 2.0.0 → 2.0.1
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 +24 -14
- package/README.zh_CN.md +24 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -200,7 +200,7 @@ export default defineConfig({
|
|
|
200
200
|
|
|
201
201
|
## Documentation
|
|
202
202
|
|
|
203
|
-
- [index.d.
|
|
203
|
+
- [index.d.mts](https://www.unpkg.com/browse/@tomjs/vite-plugin-electron/dist/index.d.mts) provided by [unpkg.com](https://www.unpkg.com).
|
|
204
204
|
|
|
205
205
|
## Parameters
|
|
206
206
|
|
|
@@ -228,24 +228,25 @@ The `recommended` option is used to set the default configuration and behavior,
|
|
|
228
228
|
|
|
229
229
|
Based on [Options](https://tsdown.dev/reference/api/Interface.UserConfig) of [tsdown](https://tsdown.dev), some default values are added for ease of use.
|
|
230
230
|
|
|
231
|
-
| Property | Type | Default | Description
|
|
232
|
-
| ----------- | ----------------------------- | ----------------------------------------------- |
|
|
233
|
-
| entry | `string` | `-` | The main process entry file.
|
|
234
|
-
| format | `'cjs' \| 'esm'` | `-` | The bundle format. If not specified, it will use the "type" field from package.json.
|
|
235
|
-
| outDir | `string` | "dist-electron/main" | The output directory for the main process files
|
|
236
|
-
| watchFiles | `string \| string[]` | `undefined` |
|
|
237
|
-
| ignoreWatch | `Arrayable<string \| RegExp>` | `'.history', '.temp', '.tmp', '.cache', 'dist'` | Ignore files or folders being watched
|
|
231
|
+
| Property | Type | Default | Description |
|
|
232
|
+
| ----------- | ----------------------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
233
|
+
| entry | `string` | `-` | The main process entry file. |
|
|
234
|
+
| format | `'cjs' \| 'esm'` | `-` | The bundle format. If not specified, it will use the "type" field from package.json. |
|
|
235
|
+
| outDir | `string` | "dist-electron/main" | The output directory for the main process files |
|
|
236
|
+
| watchFiles | `string \| string[]` | `undefined` | Watch Electron related files or folders.If `recommended:true`, it will monitor the `electron/main` directory; otherwise, you need to specify the directory corresponding to the Electron code. Failure to specify may cause Electron to restart indefinitely. |
|
|
237
|
+
| ignoreWatch | `Arrayable<string \| RegExp>` | `'.history', '.temp', '.tmp', '.cache', 'dist'` | Ignore files or folders being watched |
|
|
238
238
|
|
|
239
239
|
### PreloadOptions
|
|
240
240
|
|
|
241
241
|
Based on [Options](https://tsdown.dev/reference/api/Interface.UserConfig) of [tsdown](https://tsdown.dev), some default values are added for ease of use.
|
|
242
242
|
|
|
243
|
-
| Property
|
|
244
|
-
|
|
|
245
|
-
| entry
|
|
246
|
-
| format
|
|
247
|
-
| outDir
|
|
248
|
-
|
|
|
243
|
+
| Property | Type | Default | Description |
|
|
244
|
+
| ----------- | ----------------------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
245
|
+
| entry | `string` | `-` | The preload process entry file. |
|
|
246
|
+
| format | `'cjs' \| 'esm'` | `-` | The bundle format. If not specified, it will use the "type" field from package.json. |
|
|
247
|
+
| outDir | `string` | "dist-electron/preload" | The output directory for the preload process files |
|
|
248
|
+
| watchFiles | `string \| string[]` | `undefined` | Watch Electron related files or folders.If `recommended:true`, it will monitor the `electron/preload` directory; otherwise, you need to specify the directory corresponding to the Electron code. Failure to specify may cause Electron to restart indefinitely. |
|
|
249
|
+
| ignoreWatch | `Arrayable<string \| RegExp>` | `'.history', '.temp', '.tmp', '.cache', 'dist'` | Ignore files or folders being watched |
|
|
249
250
|
|
|
250
251
|
### BuilderOptions
|
|
251
252
|
|
|
@@ -445,3 +446,12 @@ Open the [examples](./examples) directory, there are `vue` and `react` examples.
|
|
|
445
446
|
|
|
446
447
|
- [react](./examples/react)
|
|
447
448
|
- [vue](./examples/vue)
|
|
449
|
+
|
|
450
|
+
## Important Notes
|
|
451
|
+
|
|
452
|
+
### v2.0.0
|
|
453
|
+
|
|
454
|
+
**Breaking Updates:**
|
|
455
|
+
|
|
456
|
+
- Using [tsdown](https://tsdown.dev/zh-CN) instead of [tsup](https://tsup.egoist.dev/), the main/preload configuration is changed to inherit [tsdown](https://tsdown.dev/zh-CN).
|
|
457
|
+
- If `recommended:true` is not used, `watchFiles` needs to be configured. See [MainOptions](#mainoptions) and [PreloadOptions](#preloadoptions) for details.
|
package/README.zh_CN.md
CHANGED
|
@@ -201,7 +201,7 @@ export default defineConfig({
|
|
|
201
201
|
|
|
202
202
|
## 文档
|
|
203
203
|
|
|
204
|
-
- [unpkg.com](https://www.unpkg.com/) 提供的 [index.d.
|
|
204
|
+
- [unpkg.com](https://www.unpkg.com/) 提供的 [index.d.mts](https://app.unpkg.com/@tomjs/vite-plugin-electron@2.0.0/files/dist/index.d.mts).
|
|
205
205
|
|
|
206
206
|
## 参数
|
|
207
207
|
|
|
@@ -227,24 +227,25 @@ export default defineConfig({
|
|
|
227
227
|
|
|
228
228
|
继承自 [tsdown](https://tsdown.dev/) 的 [Options](https://tsdown.dev/zh-CN/reference/api/Interface.UserConfig),添加了一些默认值,方便使用。
|
|
229
229
|
|
|
230
|
-
| 参数名 | 类型 | 默认值 | 说明
|
|
231
|
-
| ----------- | ----------------------------- | ----------------------------------------------- |
|
|
232
|
-
| **entry** | `string` | `-` | main 入口文件
|
|
233
|
-
| format | `'cjs' \| 'esm'` | `-` | 打包格式。如果未指定,将使用 package.json 中的 "type" 字段
|
|
234
|
-
| outDir | `string` | `"dist-electron/main"` | main 输出文件夹
|
|
235
|
-
| watchFiles | `string \| string[]` | `undefined` | 监听 electron
|
|
236
|
-
| ignoreWatch | `Arrayable<string \| RegExp>` | `'.history', '.temp', '.tmp', '.cache', 'dist'` | 忽略监听的文件或文件夹
|
|
230
|
+
| 参数名 | 类型 | 默认值 | 说明 |
|
|
231
|
+
| ----------- | ----------------------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
232
|
+
| **entry** | `string` | `-` | main 入口文件 |
|
|
233
|
+
| format | `'cjs' \| 'esm'` | `-` | 打包格式。如果未指定,将使用 package.json 中的 "type" 字段 |
|
|
234
|
+
| outDir | `string` | `"dist-electron/main"` | main 输出文件夹 |
|
|
235
|
+
| watchFiles | `string \| string[]` | `undefined` | 监听 electron 相关文件或文件夹。如果 `recommended:true`,则监听 `electron/main` 目录,否则需要指定 electron 代码对应目录,如果没有指定可能会造成 electron 无限重启 |
|
|
236
|
+
| ignoreWatch | `Arrayable<string \| RegExp>` | `'.history', '.temp', '.tmp', '.cache', 'dist'` | 忽略监听的文件或文件夹 |
|
|
237
237
|
|
|
238
238
|
### PreloadOptions
|
|
239
239
|
|
|
240
240
|
继承自 [tsdown](https://tsdown.dev) 的 [Options](https://tsdown.dev/zh-CN/reference/api/Interface.UserConfig),添加了一些默认值,方便使用。
|
|
241
241
|
|
|
242
|
-
| 参数名
|
|
243
|
-
|
|
|
244
|
-
| **entry**
|
|
245
|
-
| format
|
|
246
|
-
| outDir
|
|
247
|
-
|
|
|
242
|
+
| 参数名 | 类型 | 默认值 | 说明 |
|
|
243
|
+
| ----------- | ----------------------------- | ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
244
|
+
| **entry** | `string` | `-` | preload 入口文件 |
|
|
245
|
+
| format | `'cjs' \| 'esm'` | `-` | 打包格式。如果未指定,将使用 package.json 中的 "type" 字段 |
|
|
246
|
+
| outDir | `string` | `"dist-electron/preload"` | preload 输出文件夹 |
|
|
247
|
+
| watchFiles | `string \| string[]` | `undefined` | 监听 electron 相关文件或文件夹。如果 `recommended:true`,则监听 `electron/preload` 目录,否则需要指定 electron 代码对应目录,如果没有指定可能会造成 electron 无限重启 |
|
|
248
|
+
| ignoreWatch | `Arrayable<string \| RegExp>` | `'.history', '.temp', '.tmp', '.cache', 'dist'` | 忽略监听的文件或文件夹 |
|
|
248
249
|
|
|
249
250
|
### BuilderOptions
|
|
250
251
|
|
|
@@ -444,3 +445,12 @@ pnpm build
|
|
|
444
445
|
|
|
445
446
|
- [react](./examples/react)
|
|
446
447
|
- [vue](./examples/vue)
|
|
448
|
+
|
|
449
|
+
## 重要说明
|
|
450
|
+
|
|
451
|
+
### v2.0.0
|
|
452
|
+
|
|
453
|
+
**破坏性更新:**
|
|
454
|
+
|
|
455
|
+
- 使用 [tsdown](https://tsdown.dev/zh-CN) 替代 [tsup](https://tsup.egoist.dev/),main/preload 配置改为继承 [tsdown](https://tsdown.dev/zh-CN).
|
|
456
|
+
- 如果没有使用 `recommended:true`,需要配置 `watchFiles`,详见 [MainOptions](#mainoptions)和 [PreloadOptions](#preloadoptions)
|
package/package.json
CHANGED