-
Notifications
You must be signed in to change notification settings - Fork 27
/
webpack.config.js
66 lines (57 loc) · 1.58 KB
/
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
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
const fs = require('fs')
const webpack = require('webpack')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
module.exports = {
// base dir for resolving entry option
context: __dirname,
entry: ['./assets.js'],
node: {
__filename: false,
__dirname: false,
},
target: 'node',
output: {
path: __dirname,
filename: 'appifi.js'
},
externals: {
// "../build/Release/hash": `commonjs ./bin/xxhash.node`,
"../build/Release/hash": `commonjs ./bin/xxhash.node`,
"./build/Release/xattr": `commonjs ./bin/xattr.node`,
"./build/Release/bcrypt": `commonjs ./bin/bcrypt.node`,
"./build/Release/crypt3": `commonjs ./bin/crypt3.node`,
'./build/Release/crypt3async': `commonjs ./bin/crypt3async.node`,
'bcrypt': 'bcrypt',
'ws': 'ws',
'bindings': 'bindings',
'colors': 'colors',
'express': 'express'
},
module: {
rules: [
{ test: /\.json$/, enforce: 'pre', loader: 'json-loader' },
{ test: /\.node$/, enforce: 'pre', loader: 'node-loader' },
{ test: /\.base64$/, loader: 'raw-loader' }
],
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['es2015', 'bluebird'],
plugins: [
"transform-async-to-bluebird",
"transform-promise-to-bluebird",
"transform-runtime"
]
}
}
]
},
plugins: [
new webpack.DefinePlugin({ "global.GENTLY": false }),
new webpack.DefinePlugin({ "global.WEBPACK": true }),
// new UglifyJSPlugin(),
],
}