Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
electron-forge-plugin-vite
Advanced tools
Vite plugin for Electron Forge, lets you use Vite directly in your tooling
Since Electron Forge v6.1.1 started supporting Vite.
├─┬ plugin
│ │
│ ├─┬ src
│ │ ├── util/
│ │ └── VitePlugin.ts `electron-forge-plugin-vite`
│ │
│ ├─┬ src-migration
│ │ └── index.ts `electron-forge-plugin-vite/migration`
│ │
│ └─┬ src-plugin
│ └── index.ts `electron-forge-plugin-vite/plugin`
│
For test electron-forge
Vite template.
🚨 This is just a test version of the official plugin
@electron-forge/plugin-vite
and is only intended as a test for the development phase.
# npm
npm i -g electron-forge-template-vite-typescript
npm create electron-app my-vite-app --template=vite-typescript
# yarn
yarn global add electron-forge-template-vite-typescript
yarn create electron-app my-vite-app --template=vite-typescript
electron-forge-plugin-vite@0.4.0+
// vite.main.config.mjs - For Electron Main
// vite.preload.config.mjs - For Preload Scripts
import { defineConfig } from 'vite';
import { restart } from 'electron-forge-plugin-vite/plugin';
// https://vitejs.dev/config
export default defineConfig({
plugins: [restart()],
});
Migrate to v7.3.0+
version.
Why not the Vite plugin? Because dynamically inserting new plugins into the
vite.config.ts
in the plugin does not work!
vite.main.config.ts
import { defineConfig } from 'vite';
// https://vitejs.dev/config
export default defineConfig({
resolve: {
// Some libs that can run in both Web and Node.js, such as `axios`, we need to tell Vite to build them in Node.js.
browserField: false,
conditions: ['node'],
mainFields: ['module', 'jsnext:main', 'jsnext'],
},
});
vite.main.config.ts
import { defineConfig, mergeConfig } from 'vite';
import { to7_3_0_config } from 'electron-forge-plugin-vite/migration';
// https://vitejs.dev/config
export default defineConfig(async (env) => {
return mergeConfig(
await to7_3_0_config.main(env),
{
resolve: {
// Some libs that can run in both Web and Node.js, such as `axios`, we need to tell Vite to build them in Node.js.
browserField: false,
conditions: ['node'],
mainFields: ['module', 'jsnext:main', 'jsnext'],
},
},
);
});
vite.renderer.config.ts
import { defineConfig } from 'vite';
// https://vitejs.dev/config
export default defineConfig({});
vite.renderer.config.ts
import { defineConfig, mergeConfig } from 'vite';
import { to7_3_0_config } from 'electron-forge-plugin-vite/migration';
// https://vitejs.dev/config
export default defineConfig(async (env) => {
return mergeConfig(
await to7_3_0_config.renderer(env),
{/* You Vite config here... */ },
);
});
vite.preload.config.ts
import { defineConfig } from 'vite';
// https://vitejs.dev/config
export default defineConfig({});
vite.preload.config.ts
import { defineConfig, mergeConfig } from 'vite';
import { to7_3_0_config } from 'electron-forge-plugin-vite/migration';
// https://vitejs.dev/config
export default defineConfig(async (env) => {
return mergeConfig(
await to7_3_0_config.preload(env),
{/* You Vite config here... */ },
);
});
FAQs
Vite plugin for Electron Forge, lets you use Vite directly in your tooling
The npm package electron-forge-plugin-vite receives a total of 10 weekly downloads. As such, electron-forge-plugin-vite popularity was classified as not popular.
We found that electron-forge-plugin-vite demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.