-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V0.10.0 #89
V0.10.0 #89
Conversation
…ly set `format=cjs`
@astoilkov @jooy2 Hi here! 👋 |
Thanks for the quick update! npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/vite
npm ERR! dev vite@"^3.1.6" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vite@">=3.2.0" from [email protected]
npm ERR! node_modules/vite-plugin-electron
npm ERR! dev vite-plugin-electron@"0.10.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\user\AppData\Local\npm-cache\eresolve-report.txt for a full rep
ort.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Local\npm-cache\_logs\2022-10-10T04_47_39_548Z-deb
ug-0.log
For more detail, add `--debug` to the command |
The change to
|
|
Sorry, I didn't understand that, but no worries, I will check it myself. |
These will be the default behavior of Vite.
await import('./path')
↓
await Promise.resolve(require('./path'))
await import('./path')
↓
await import('./path')
|
@astoilkov Hi! 👋 My good friend. export default {
plugins: [
renderer({
+ resolve(dependencies) {
+ return dependencies
+ },
nodeIntegration: true,
}),
],
worker: {
plugins: [
worker({
+ resolve(dependencies) {
+ return dependencies
+ },
nodeIntegrationInWorker: true,
}),
],
},
}
|
0.10.0 (2022-10-09)
Break!
This is a redesigned version of the API(Only 3 APIs). Not compatible with previous versions!
In the past few weeks, some issues have been mentioned in many issues that cannot be solved amicably. So I refactored the API to avoid design flaws. But despite this, the new version will only be easier rather than harder.
For example, some common problems in the following issues.
Multiple entry files is not support #86
Thanks to [email protected]'s
lib.entry
supports multiple entries, which makes the configuration of the new version very simple. So the[email protected]
requires Vite at leastv3.2.0
.e.g.
require is not defined #48, #87
vite-plugin-electron-renderer
will changeoutput.format
tocjs
format by default(This is because currently Electron@21 only supports CommonJs), which will cause the built code to userequire
to import modules, if the usernodeIntegration
is not enabled in the Electron-Main process which causes the errorrequire is not defined
to be thrown.[email protected]
provides thenodeIntegration
option. It is up to the user to decide whether to use Node.js(CommonJs).e.g.
Use
Worker
in Electron-Main or Electron-Renderer #77, #81Use Worker in Electron-Main
e.g. This looks the same as multiple entry
Use Worker in Electron-Renderer
e.g.
TODO