forked from VOICEVOX/voicevox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
137 lines (130 loc) · 3.79 KB
/
vue.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require("path");
// eslint-disable-next-line @typescript-eslint/no-var-requires
const process = require("process");
const VOICEVOX_ENGINE_DIR =
process.env.VOICEVOX_ENGINE_DIR ?? "../voicevox_engine/run.dist/";
// ${productName} Web Setup ${version}.${ext}
const NSIS_WEB_ARTIFACT_NAME = process.env.NSIS_WEB_ARTIFACT_NAME;
// ${productName}-${version}.${ext}
const LINUX_ARTIFACT_NAME = process.env.LINUX_ARTIFACT_NAME;
// ${packageName}
const LINUX_EXECUTABLE_NAME = process.env.LINUX_EXECUTABLE_NAME;
// ${productName}-${version}.${ext}
const MACOS_ARTIFACT_NAME = process.env.MACOS_ARTIFACT_NAME;
const isMac = process.platform === "darwin";
module.exports = {
configureWebpack: {
devtool: "source-map",
},
pluginOptions: {
electronBuilder: {
preload: "src/electron/preload.ts",
builderOptions: {
fileAssociations: [
{
ext: "vvproj",
name: "VOICEVOX Project file",
description: "VOICEVOX Project file",
role: "Editor",
icon: "icons/vvproj." + (isMac ? "icns" : "ico"),
},
{
ext: "vvpp",
name: "VOICEVOX Plugin package",
description: "VOICEVOX Plugin package",
role: "Editor",
icon: "icons/vvpp." + (isMac ? "icns" : "ico"),
},
{
ext: "vvppp",
name: "VOICEVOX Plugin package (part)",
description: "VOICEVOX Plugin package (part)",
role: "Editor",
icon: "icons/vvpp." + (isMac ? "icns" : "ico"),
},
],
extraFiles: [
{ from: "build/README.txt", to: "README.txt" },
{ from: ".env.production", to: ".env" },
{
from: VOICEVOX_ENGINE_DIR,
to: "",
},
],
// electron-builder installer
productName: "VOICEVOX",
appId: "jp.hiroshiba.voicevox",
copyright: "Hiroshiba Kazuyuki",
afterAllArtifactBuild: path.resolve(
__dirname,
"build",
"afterAllArtifactBuild.js"
),
win: {
icon: "public/icon.png",
target: [
{
target: "nsis-web",
arch: ["x64"],
},
],
},
directories: {
buildResources: "build",
},
nsisWeb: {
artifactName:
NSIS_WEB_ARTIFACT_NAME !== "" ? NSIS_WEB_ARTIFACT_NAME : undefined,
include: "build/installer.nsh",
oneClick: false,
allowToChangeInstallationDirectory: true,
},
publish: {
provider: "github",
repo: "voicevox",
vPrefixedTagName: false,
},
linux: {
artifactName:
LINUX_ARTIFACT_NAME !== "" ? LINUX_ARTIFACT_NAME : undefined,
executableName:
LINUX_EXECUTABLE_NAME !== "" ? LINUX_EXECUTABLE_NAME : undefined,
icon: "public/icon.png",
category: "AudioVideo",
mimeTypes: ["application/x-voicevox"],
target: [
{
target: "AppImage",
arch: ["x64"],
},
],
},
mac: {
artifactName:
MACOS_ARTIFACT_NAME !== "" ? MACOS_ARTIFACT_NAME : undefined,
icon: "public/icon-mac.png",
category: "public.app-category.utilities",
target: [
{
target: "dmg",
arch: ["x64"],
},
],
},
dmg: {
icon: "public/icon-dmg.icns",
},
},
},
},
css: {
loaderOptions: {
sass: {
sassOptions: {
includePaths: [path.resolve(__dirname, "node_modules")],
},
},
},
},
};