-
Notifications
You must be signed in to change notification settings - Fork 18
/
vue.config.js
95 lines (93 loc) · 2.85 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
const { defineConfig } = require('@vue/cli-service')
const webpack = require('webpack')
module.exports = defineConfig({
publicPath: "/",
pluginOptions: {
electronBuilder: {
externals: [
'adm-zip',
'bindings',
'send-keys-native',
'arraybuffer-to-buffer',
'vue-router',
'ws',
'sudo-prompt',
'fs-extra',
'electron-log',
'electron-updater',
],
builderOptions: {
extraFiles: [
{
from: 'libs/flo-worker.exe',
to: './resources/app.asar.unpacked/flo-worker.exe',
},
{
from: 'libs/flo-worker',
to: './resources/app.asar.unpacked/flo-worker',
}
],
// TODO: Revert this when we can sign again
// afterSign: "notarize.js",
mac: {
hardenedRuntime : true,
gatekeeperAssess: false,
entitlements: "build/entitlements.mac.inherit.plist",
entitlementsInherit: "build/entitlements.mac.inherit.plist",
type: "distribution"
},
dmg: {
sign: false
},
win: {
publisherName: ["Deespul LLC"],
target: ["nsis"]
},
publish: [{
provider: "github",
owner: "w3champions",
repo: "w3champions-launcher"
}]
}
}
},
configureWebpack: (config) => {
config.module.rules = [...config.module.rules, {
test: /\.(png|jpg|gif|svg|xcf|otf|webm)$/i,
loader: 'url-loader',
options: {
esModule: false,
},
type: 'javascript/auto'
}]
if (process.env.NODE_ENV === "development") {
config.devtool = "eval-source-map";
config.output.devtoolModuleFilenameTemplate = (info) =>
info.resourcePath.match(/\.vue$/) &&
!info.identifier.match(/type=script/) // this is change ✨
? `webpack-generated:///${info.resourcePath}?${info.hash}`
: `webpack-yourCode:///${info.resourcePath}`;
config.output.devtoolFallbackModuleFilenameTemplate =
"webpack:///[resource-path]?[hash]";
}
config.plugins = [
...config.plugins,
new webpack.DefinePlugin({
'__VUE_PROD_HYDRATION_MISMATCH_DETAILS__': JSON.stringify(false),
}),
],
config.resolve.fallback = {
"fs": require.resolve("fs-extra"),
"net": require.resolve("net"),
"path": require.resolve("path-browserify"),
"zlib": require.resolve("browserify-zlib"),
"http": require.resolve("stream-http"),
"https": require.resolve("https-browserify"),
"stream": require.resolve("stream-browserify"),
"crypto": require.resolve("crypto-browserify"),
"crypto-browserify": require.resolve("crypto-browserify"),
"util": require.resolve("util/"),
"vm": require.resolve("vm-browserify"),
}
},
});