vite-plugin-electrons
v1.0.2
Published
electron vite
Downloads
6
Readme
vite-plugin-electrons
使用说明
npm i -D vite-plugin-electrons
1.在 vite.config.ts 里面增加插件 demo1:
import electron from 'vite-plugin-electrons';
export default {
plugins: [
electron({
entry: ['electron/main.ts', 'electron/preload.ts'],
vite: {
build: {
outDir: 'dist-electron',
},
},
}),
],
};
demo2:
import electron from 'vite-plugin-electrons';
export default {
plugins: [
electron([
{
entry: 'electron/main.ts',
vite: {
build: {
outDir: 'dist-electron',
},
},
},
{
entry: 'electron/preload.ts',
vite: {
build: {
outDir: 'dist-electron',
},
},
},
]),
],
};
2.在 package.json 里面增加
{
+ "main": "dist-electron/main.js"
}