forked from sige5193/bittly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
135 lines (126 loc) · 4.31 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
/**
* set configuration variables
*/
console.log(`NODE_ENV : ${process.env.NODE_ENV}`);
console.log(`BITTLY_HOST_TYPE : ${process.env.BITTLY_HOST_TYPE}`);
console.log(`BITTLY_WEBAPP_ASSETS_PATH : ${process.env.BITTLY_WEBAPP_ASSETS_PATH}`);
let productionSourceMap = false;
let publicPath = '/';
let pageTemplate = 'public/index.html';
if ( 'development' === process.env.NODE_ENV ) {
productionSourceMap = true;
} else if ( 'production' === process.env.NODE_ENV && 'browser' === process.env.BITTLY_HOST_TYPE ) {
publicPath = process.env.BITTLY_WEBAPP_ASSETS_PATH;
pageTemplate = 'public/index-webapp.html';
productionSourceMap = true;
}
/**
* configurations for vue cli
* @link https://cli.vuejs.org/config/
*/
module.exports = {
/**
* The base URL your application bundle will be deployed at.
* @property {String}
* @link https://cli.vuejs.org/config/#publicpath
*/
publicPath : publicPath,
/**
* Setting this to false can speed up production builds if you don't need source maps for production.
* @property {String}
* @link https://cli.vuejs.org/config/#productionsourcemap
*/
// productionSourceMap : productionSourceMap,
/**
* webpack configurations
* @property {Object}
* @see {webpack.config.js}
* @link https://cli.vuejs.org/config/#configurewebpack
*/
configureWebpack: require('./webpack.config.js'),
/**
* css options
*/
css: {
extract : 'development' === process.env.NODE_ENV ? false : {
ignoreOrder: true
}
},
/**
* build the app in multi-page mode
* @property {Object}
* @link https://cli.vuejs.org/config/#pages
*/
pages: {
index: {
entry: 'src/main.js',
template: pageTemplate,
filename: 'index.html',
title: 'Bittly',
chunks: ['chunk-vendors', 'chunk-common', 'index']
},
toolTerminal : {
entry: 'src/tools/terminal/index.js',
template: pageTemplate,
filename: 'tool-terminal.html',
title: 'Terminal',
chunks: ['chunk-vendors', 'chunk-common', 'toolTerminal']
},
toolCalculator : {
entry: 'src/tools/calculator/index.js',
template: pageTemplate,
filename: 'tool-calculator.html',
title: 'Calculator',
chunks: ['chunk-vendors', 'chunk-common', 'toolCalculator']
},
},
pluginOptions: {
/**
* configurations for electron builder plugin
* @link https://nklayman.github.io/vue-cli-plugin-electron-builder/guide/configuration.html
*/
electronBuilder: {
externals: ['serialport','bluetooth-serial-port'],
preload: 'src/preload.js',
/**
* electron-builder options
* @link https://www.electron.build/configuration/configuration
*/
builderOptions : {
npmRebuild : false,
win : {
target : ['nsis','zip'],
icon : "build/icon.ico",
},
linux : {
target : ['AppImage'],
icon: "build/icon/",
category : "Development",
},
nsis: {
allowToChangeInstallationDirectory: true,
oneClick: false,
installerIcon : 'build/installer-icon.ico',
uninstallerIcon : 'build/uninstall-icon.ico',
createDesktopShortcut : true,
createStartMenuShortcut : true,
artifactName : "bittly-${version}-win-${arch}.exe",
menuCategory : 'Bittly',
},
appImage : {
artifactName : "bittly-${version}-${arch}.AppImage",
},
dmg: {
// artifactName : "bittly-${version}-${arch}.AppImage",
icon : "build/icon/Icon-512x512.png",
},
extraFiles : [
],
publish : [{
provider : "generic",
url : "http://127.0.0.1/update/",
}],
},
},
},
}