forked from watson-developer-cloud/node-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
36 lines (34 loc) · 1.09 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
'use strict';
// With this configuration, the entire library can be bundled with Webpack.
// However, not all services support client-side usage.
// See https://github.com/watson-developer-cloud/node-sdk/tree/master/examples/webpack for details
module.exports = {
entry: './index.js',
output: {
filename: 'watson-developer-cloud.js',
library: 'WatsonDeveloperCloud',
libraryTarget: 'umd'
},
// http://webpack.github.io/docs/configuration.html#node
node: {
fs: 'empty',
net: 'empty',
tls: 'empty'
},
// Loader for Retrieve & Rank
// Retrieve & Rank depends on solr-client, which depends on JSONStream, which starts with a shebang line, which
// Webpack chokes on - this strips off that line.
//
// This isn't strictly needed because Retrieve & Rank doesn't support CORS, so there's no reason to include it in a
// bundle. However, it's preserved here just to make things easy.
//
// See https://github.com/webpack/webpack/issues/2168 for more info
module: {
rules: [
{
test: /JSONStream/,
use: 'shebang-loader'
}
]
}
};