forked from minbrowser/min
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildMain.js
46 lines (40 loc) · 1.05 KB
/
buildMain.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
const path = require('path')
const fs = require('fs')
const outFile = path.resolve(__dirname, '../main.build.js')
const modules = [
'dist/localization.build.js',
'main/windowManagement.js',
'js/util/keyMap.js',
'main/menu.js',
'main/touchbar.js',
'main/registryConfig.js',
'js/util/settings/settingsMain.js',
'main/main.js',
'main/minInternalProtocol.js',
'main/filtering.js',
'main/viewManager.js',
'main/download.js',
'main/UASwitcher.js',
'main/permissionManager.js',
'main/prompt.js',
'main/remoteMenu.js',
'main/remoteActions.js',
'main/keychainService.js',
'js/util/proxy.js',
'main/themeMain.js'
]
function buildMain () {
// build localization support first, since it is included in the bundle
require('./buildLocalization.js')()
/* concatenate modules */
let output = ''
modules.forEach(function (script) {
output += fs.readFileSync(path.resolve(__dirname, '../', script)) + ';\n'
})
fs.writeFileSync(outFile, output, 'utf-8')
}
if (module.parent) {
module.exports = buildMain
} else {
buildMain()
}