298e4de refactor(renderer):electron-renderer/plugins->electron-renderer/src 841cbd1 docs(electron-renderer): update 3994b9a chore(electron-renderer): fix link 72efa81 docs(electron-renderer): update [2022-07-19] v0.6.0 be80d0cvite-plugin-electron-renderer@0.6.0 7e69a7c docs:`vite-plugin-...
1# vite-plugin-electron-renderer 2 3[English](https://github.com/electron-vite/vite-plugin-electron-renderer#readme) | 简体中文 4 5## 原理 6 7> 加载 Electron、Node.js CJS 包/内置模块/electron (示意图) 8 9``` 10┏———┓ ┏———┓ 11│ import { ipcRenderer } from 'electron' ...
// vite.main.tsimport{builtinModules}from'module'exportdefault{build:{outDir:'dist/electron',lib:{entry:'electron/main.ts',formats:['cjs'],fileName:()=>'[name].js',},rollupOptions:{external:['electron',...builtinModules,],},},} 构建Renderer Renderer 无需额外的配置,Vite 在 Web 构建...
import renderer from '@tomjs/vite-plugin-electron-renderer'; export default { plugins: [ renderer(), ], }Using the third-part C/C++, esm package in the Renderer process.import renderer from '@tomjs/vite-plugin-electron-renderer'; export default { plugins: [ renderer({ resolve: { // C...
import electron from 'vitejs-plugin-electron/renderer' export default { plugins: [ electron(), ], // 其他配置略... } 至此,import electron from 'electron' 也可以正常工作了 // ✅ 可以正常工作 import { ipcRenderer } from 'electron' 总结 Vite 个人觉得是个不错的方案,毕竟打包工具早晚会...
electron([ { entry:"electron/main.ts",//preload: {///Shortcut of `build.rollupOptions.input`//input: "electron/preload.ts",//},///Optional: Use Node.js API in the Renderer process//renderer: {},vite: { build: { outDir:"dist-electron"} }, },...
import electronRenderer from"vite-plugin-electron-renderer"; ... plugins: [ ..., electron({ entry:"electron-main/index.ts",//主进程文件}), electronRenderer(), ], build: { emptyOutDir:false, }, 修改tsconfig.json "include": [..., "electron-main/**/*.ts"] ...
16 * @see https://github.com/electron-vite/vite-plugin-electron-renderer 17 */ 18 renderer?: import('vite-plugin-electron-renderer').RendererOptions; 19 } 20 export default function electronSimple(options: ElectronSimpleOptions): Promise<Plugin[]>; ...
electron([{ entry: "electron-main/index.ts", //主进程 }, { entry: "electron-preload/preload.ts" }]), electronRenderer(), polyfillExports(), // 按需引入AntDesignVue ViteComponents({customComponentResolvers: [AntDesignVueResolver()],}), ...
"vite-plugin-electron": "0.11.1", "vite-plugin-electron-renderer": "0.11.4", "vue": "3.2.45", "vue-tsc": "1.0.24", "@vue/eslint-config-typescript": "11.0.0", "eslint": "8.20.0", "eslint-plugin-vue": "9.2.0",