forked from Dynalon/autobahn-ts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
42 lines (39 loc) · 1.12 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
var path = require('path');
// TODO: browsers tests with actual autobahn.js bundled by the build tool
// (not identic copy)
module.exports = {
target: 'web',
entry: 'src/autobahn-browser.js',
resolve: {
root: path.resolve('./dist/'),
extensions: ['', '.json', '.js']
},
output: {
path: __dirname + '/dist/browser/',
filename: 'autobahn.js',
// will be the global variable that the autobahn.js file exports to
library: 'autobahn',
libraryTarget: 'var'
},
externals: {
// This *has* to exactly match the string as used in the require() statement including
// the leading .
'net': true,
'fs': true,
'ws': true,
'crypto-js': true,
// HACK to make webpack happy - we don't include these at all for
// browser builds
'nonexistingmodule': true,
'./transport/rawsocket': 'nonexistingmodule',
'./websocket-node': 'nonexistingmodule',
},
module: {
loaders: [
{
test: /\.json$/,
loader: 'json'
}
]
}
};