@tomjs/vite-plugin-electron 1.3.6 → 1.3.7
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 +1 -12
- package/README.zh_CN.md +1 -12
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -261,7 +261,7 @@ app.whenReady().then(() => {
|
|
|
261
261
|
|
|
262
262
|
Start code compilation through the following configuration or `ELECTRON_DEBUG=1 vite dev`
|
|
263
263
|
|
|
264
|
-
- Enable by setting `APP_ELECTRON_DEBUG=1` in `.env` file
|
|
264
|
+
- Enable by setting `APP_ELECTRON_DEBUG=1` in `.env.development` file
|
|
265
265
|
- `vite.config.js` configures `electron({ debug: true })` to be turned on
|
|
266
266
|
|
|
267
267
|
#### VSCODE
|
|
@@ -289,14 +289,3 @@ Run `Debug Main Process` through `vscode` to debug the main thread. For debuggin
|
|
|
289
289
|
]
|
|
290
290
|
}
|
|
291
291
|
```
|
|
292
|
-
|
|
293
|
-
**Notice**
|
|
294
|
-
|
|
295
|
-
Although `Electron v28` supports `esm`, there may be problems with `VSCode Debug` sourcemap support and breakpoints cannot work properly. In this case, you can use `cjs` mode or turn off `sourcemap`
|
|
296
|
-
|
|
297
|
-
```ts
|
|
298
|
-
electron({
|
|
299
|
-
main: { sourcemap: false },
|
|
300
|
-
preload: { sourcemap: false },
|
|
301
|
-
});
|
|
302
|
-
```
|
package/README.zh_CN.md
CHANGED
|
@@ -260,7 +260,7 @@ app.whenReady().then(() => {
|
|
|
260
260
|
|
|
261
261
|
通过如下配置或者 `ELECTRON_DEBUG=1 vite dev` 启动代码编译
|
|
262
262
|
|
|
263
|
-
- 通过 `.env` 文件设置 `APP_ELECTRON_DEBUG=1` 开启
|
|
263
|
+
- 通过 `.env.development` 文件设置 `APP_ELECTRON_DEBUG=1` 开启
|
|
264
264
|
- `vite.config.js` 配置 `electron({ debug: true })` 开启
|
|
265
265
|
|
|
266
266
|
#### VSCODE
|
|
@@ -288,14 +288,3 @@ app.whenReady().then(() => {
|
|
|
288
288
|
]
|
|
289
289
|
}
|
|
290
290
|
```
|
|
291
|
-
|
|
292
|
-
**说明**
|
|
293
|
-
|
|
294
|
-
`Electron v28` 虽然支持了 `esm`,但是 `VSCode Debug` sourcemap支持可能有问题,断点无法正常工作。这种情况可以使用 `cjs` 模式或关闭 `sourcemap`。
|
|
295
|
-
|
|
296
|
-
```ts
|
|
297
|
-
electron({
|
|
298
|
-
main: { sourcemap: false },
|
|
299
|
-
preload: { sourcemap: false },
|
|
300
|
-
});
|
|
301
|
-
```
|
package/dist/index.js
CHANGED
|
@@ -179,6 +179,7 @@ function preMergeOptions(options) {
|
|
|
179
179
|
format,
|
|
180
180
|
clean: true,
|
|
181
181
|
dts: false,
|
|
182
|
+
treeshake: !!isDev,
|
|
182
183
|
outExtension({ format: format2 }) {
|
|
183
184
|
return {
|
|
184
185
|
js: format2 === "esm" ? ".mjs" : `.js`
|
|
@@ -297,7 +298,6 @@ function vitePluginElectron(options) {
|
|
|
297
298
|
const env = Object.keys(process.env).filter((s) => s.startsWith("APP_") || s.startsWith("VITE_")).map((s) => `${s}=${process.env[s]}`).join("\n");
|
|
298
299
|
_fs.writeFileSync.call(void 0, _path2.default.join(DEBUG_PATH, ".env"), `NODE_ENV=development
|
|
299
300
|
${env}`);
|
|
300
|
-
console.log("Server is running");
|
|
301
301
|
await runServe(opts, server);
|
|
302
302
|
});
|
|
303
303
|
},
|
package/dist/index.mjs
CHANGED
|
@@ -178,6 +178,7 @@ function preMergeOptions(options) {
|
|
|
178
178
|
format,
|
|
179
179
|
clean: true,
|
|
180
180
|
dts: false,
|
|
181
|
+
treeshake: !!isDev,
|
|
181
182
|
outExtension({ format: format2 }) {
|
|
182
183
|
return {
|
|
183
184
|
js: format2 === "esm" ? ".mjs" : `.js`
|
|
@@ -296,7 +297,6 @@ function vitePluginElectron(options) {
|
|
|
296
297
|
const env = Object.keys(process.env).filter((s) => s.startsWith("APP_") || s.startsWith("VITE_")).map((s) => `${s}=${process.env[s]}`).join("\n");
|
|
297
298
|
writeFileSync(path.join(DEBUG_PATH, ".env"), `NODE_ENV=development
|
|
298
299
|
${env}`);
|
|
299
|
-
console.log("Server is running");
|
|
300
300
|
await runServe(opts, server);
|
|
301
301
|
});
|
|
302
302
|
},
|