vite-plugin-electron-renderer
Advanced tools
Comparing version 0.6.0 to 0.8.1
{ | ||
"name": "vite-plugin-electron-renderer", | ||
"version": "0.6.0", | ||
"version": "0.8.1", | ||
"description": "Support use Node.js API in Electron-Renderer", | ||
"main": "dist/index.js", | ||
"main": "plugins/index.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/electron-vite/vite-plugin-electron-renderer.git", | ||
"url": "git+https://github.com/electron-vite/vite-plugin-electron.git", | ||
"directory": "packages/electron-renderer" | ||
@@ -13,10 +13,13 @@ }, | ||
"license": "MIT", | ||
"scripts": { | ||
"dev": "rm -rf dist && tsc --watch", | ||
"build": "rm -rf dist && tsc", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@types/node": "^18.0.3", | ||
"typescript": "^4.7.4", | ||
"vite": "^3.0.2" | ||
}, | ||
"files": [ | ||
"dist" | ||
"plugins" | ||
], | ||
@@ -28,7 +31,3 @@ "keywords": [ | ||
"renderer" | ||
], | ||
"scripts": { | ||
"dev": "rm -rf dist && tsc --watch", | ||
"build": "rm -rf dist && tsc" | ||
} | ||
} | ||
] | ||
} |
@@ -5,4 +5,4 @@ # vite-plugin-electron-renderer | ||
[![NPM version](https://img.shields.io/npm/v/vite-plugin-electron-renderer.svg?style=flat)](https://npmjs.org/package/vite-plugin-electron-renderer) | ||
[![NPM Downloads](https://img.shields.io/npm/dm/vite-plugin-electron-renderer.svg?style=flat)](https://npmjs.org/package/vite-plugin-electron-renderer) | ||
[![NPM version](https://img.shields.io/npm/v/vite-plugin-electron-renderer.svg)](https://npmjs.org/package/vite-plugin-electron-renderer) | ||
[![NPM Downloads](https://img.shields.io/npm/dm/vite-plugin-electron-renderer.svg)](https://npmjs.org/package/vite-plugin-electron-renderer) | ||
@@ -94,7 +94,7 @@ English | [简体中文](https://github.com/electron-vite/vite-plugin-electron/blob/main/packages/electron-renderer/README.zh-CN.md) | ||
First put the Node.js(CJS) packages into `dependencies`. | ||
First, put the Node.js(CJS) packages into `dependencies`. | ||
Second, you need to explicitly specify which packages are Node.js(CJS) packages for `vite-plugin-electron-renderer` by `options.resolve()`. This way they will be treated as `external` modules and loaded correctly. Thereby avoiding the problems caused by the Pre-Building of Vite. | ||
Second, you need to explicitly specify which packages are Node.js(CJS) packages for `vite-plugin-electron-renderer` by `options.resolve()`. This way they will be treated as `external` modules and loaded correctly. Thereby avoiding the problems caused by the Pre-Bundling of Vite. | ||
Its actual works principle is to generate a virtual module in ESM format by `load-hook` during `vite serve` to ensure that it can work normally. It's inserted into `rollupOptions.external` during `vite build` time. | ||
It's essentially works principle is to generate a virtual module in ESM format by `load-hook` during `vite serve` to ensure that it can work normally. It's inserted into `rollupOptions.external` during `vite build` time. | ||
@@ -138,3 +138,3 @@ #### Load Node.js C/C++ native modules | ||
│ 2. Intercept in load-hook(Plugin) │ | ||
│ 3. Generate a virtual module(electron) │ | ||
│ 3. Generate a virtual ESM module(electron) │ | ||
│ ↓ │ | ||
@@ -141,0 +141,0 @@ │ const { ipcRenderer } = require('electron') │ |
@@ -7,3 +7,3 @@ # vite-plugin-electron-renderer | ||
> 通常的,Vite 可能不能正确的构建 Node.js 包,尤其是 C/C++ 原生模块,但是 Vite 可以将它们以外部包(`external`)的形式加载它们。**除非你知道如何用 Vite 正确的构建它们 -- 鲁迅** | ||
> 通常的,Vite 可能不能正确的构建 Node.js 包,尤其是 Node.js C/C++ 原生模块,但是 Vite 可以将它们以外部包(`external`)的形式加载它们。**除非你知道如何用 Vite 正确的构建它们 -- 鲁迅** | ||
@@ -88,3 +88,3 @@ <table> | ||
│ 2. Intercept in load-hook(Plugin) │ | ||
│ 3. Generate a virtual module(electron) │ | ||
│ 3. Generate a virtual ESM module(electron) │ | ||
│ ↓ │ | ||
@@ -91,0 +91,0 @@ │ const { ipcRenderer } = require('electron') │ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
29326
1
356