🎉 初始化项目 electron13 + vue3 + typescript

This commit is contained in:
muwoo
2021-11-19 15:57:25 +08:00
parent a7cbc2c890
commit 072d57f068
8 changed files with 237 additions and 75 deletions

View File

@@ -1,5 +1,5 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require('path');
const path = require("path");
module.exports = {
configureWebpack: {
@@ -9,16 +9,58 @@ module.exports = {
},
},
},
pages: {
index: {
entry: "src/renderer/main.ts",
},
},
pluginOptions: {
electronBuilder: {
mainProcessFile: 'src/main/index.ts',
mainProcessFile: "src/main/index.ts",
mainProcessWatch: ["src/main"],
// Use this to change the entry point of your app's render process. default src/[main|index].[js|ts]
builderOptions: {
// options placed here will be merged with default configuration and passed to electron-builder
},
chainWebpackRendererProcess: (config) => {
config.entryPoints.clear(); // 清空默认入口
config.entry('test').add(path.join(__dirname, "./src/renderer/main.ts")); // 重新设置
productName: "rubick2",
appId: "com.muwoo.rubick",
compression: "maximum",
directories: {
output: "build",
},
files: ["dist/electron/**/*"],
dmg: {
contents: [
{
x: 410,
y: 150,
type: "link",
path: "/Applications",
},
{
x: 130,
y: 150,
type: "file",
},
],
},
mac: {
icon: "build/icons/icon.icns",
target: "pkg",
extendInfo: {
LSUIElement: 1,
},
},
win: {
icon: "build/icons/icon.ico",
target: "nsis",
},
nsis: {
oneClick: false,
allowToChangeInstallationDirectory: true,
},
linux: {
icon: "build/icons/",
publish: ["github"],
},
},
},
},