-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathwebpack.config.js
52 lines (50 loc) · 1.34 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
const path = require('path');
const webpack = require('webpack');
const commonJSConfig = {
entry: ['core-js/stable', './lib/DAPIClient.js'],
mode: 'production',
resolve: {
fallback: {
fs: false,
http: false,
https: false,
ws: false,
crypto: require.resolve('crypto-browserify'),
buffer: require.resolve('buffer/'),
assert: require.resolve('assert-browserify'),
util: require.resolve('util/'),
os: require.resolve('os-browserify/browser'),
stream: require.resolve('stream-browserify'),
path: require.resolve('path-browserify'),
url: require.resolve('url/'),
events: require.resolve('events/'),
string_decoder: require.resolve('string_decoder/'),
zlib: require.resolve('browserify-zlib'),
process: require.resolve('process/browser'),
},
},
plugins: [
new webpack.ProvidePlugin({
Buffer: [require.resolve('buffer/'), 'Buffer'],
process: require.resolve('process/browser'),
}),
],
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules)/,
use: {
loader: 'babel-loader',
},
},
],
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'dapi-client.min.js',
library: 'DAPIClient',
libraryTarget: 'umd',
},
};
module.exports = [commonJSConfig];