
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
nuxt-electron
Advanced tools
Integrate Nuxt and Electron
# Using pnpm
pnpm add -D nuxt-electron vite-electron-plugin vite-plugin-electron-renderer electron electron-builder
# Using yarn
yarn add --dev nuxt-electron vite-electron-plugin vite-plugin-electron-renderer electron electron-builder
# Using npm
npm install --save-dev nuxt-electron vite-electron-plugin vite-plugin-electron-renderer electron electron-builder
nuxt-electron
to the modules
section of nuxt.config.ts
export default defineNuxtConfig({
modules: [
'nuxt-electron',
],
})
electron/main.ts
file and type the following codeimport { app, BrowserWindow } from 'electron'
app.whenReady().then(() => {
new BrowserWindow().loadURL(process.env.VITE_DEV_SERVER_URL)
})
main
entry to package.json
{
+ "main": "dist-electron/main.js"
}
That's it! You can now use Electron in your Nuxt app ✨
This is based on the
vite-electron-plugin
, see the Documents for more detailed options
Here is the default electron
options
export default defineNuxtConfig({
modules: [
'nuxt-electron',
],
electron: {
include: ['electron'],
outDir: 'dist-electron',
},
})
Use Node.js in Renderer process
export default defineNuxtConfig({
modules: [
'nuxt-electron',
],
electron: {
/**
* @see https://github.com/electron-vite/vite-plugin-electron-renderer
*/
renderer: {},
},
})
Let's use the official nuxt-starter-v3 template as an example
+ ├─┬ electron
+ │ └── main.ts
├─┬ public
│ └── favicon.ico
├── .gitignore
├── .npmrc
├── index.html
├── app.vue
├── nuxt.config.ts
├── package.json
├── README.md
└── tsconfig.json
By default, we force the App to run in SPA mode since we don't need SSR for desktop apps
0.4.2 (2023-03-12)
c0a9c54 feat: support use Node.js in Renderer process #14
FAQs
Nuxt Integration with Electron
The npm package nuxt-electron receives a total of 582 weekly downloads. As such, nuxt-electron popularity was classified as not popular.
We found that nuxt-electron demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.