forked from SabakiHQ/Sabaki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
38 lines (32 loc) · 879 Bytes
/
webpack.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
const path = require('path')
module.exports = (env, argv) => ({
entry: './src/components/App.js',
output: {
filename: 'bundle.js',
path: __dirname
},
devtool: argv.mode === 'production' ? false : 'cheap-module-eval-source-map',
target: 'electron-renderer',
node: {
__dirname: false
},
resolve: {
alias: {
react:
argv.mode === 'production'
? path.join(__dirname, 'node_modules/preact/dist/preact.min.js')
: 'preact',
preact:
argv.mode === 'production'
? path.join(__dirname, 'node_modules/preact/dist/preact.min.js')
: 'preact',
'prop-types': path.join(__dirname, 'src/modules/shims/prop-types.js')
}
},
externals: {
'@sabaki/i18n': 'require("@sabaki/i18n")',
'cross-spawn': 'null',
'iconv-lite': 'require("iconv-lite")',
moment: 'null'
}
})