-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
49 lines (38 loc) · 975 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
39
40
41
42
43
44
45
46
47
48
'use strict';
const webpack = require('webpack')
const path = require('path')
const TerserPlugin = require('terser-webpack-plugin')
const isProd = process.env.NODE_ENV === 'production'
module.exports = {
devtool: 'source-map',
target: 'web',
entry : './src/index.js',
output: {
path : path.resolve(__dirname, 'dist'),
filename : isProd ? 'backendless-rt-client.min.js' : 'backendless-rt-client.js',
library : 'BackendlessRTClient',
libraryTarget: 'umd'
},
module: {
noParse: /backendless-request/,
rules: [
{
test : /\.js$/,
exclude: /node_modules/,
loader : 'babel-loader'
}
]
},
optimization: {
minimize : isProd,
minimizer: [new TerserPlugin({
parallel : true,
terserOptions: {
ecma: 6,
},
})],
},
plugins: [
new webpack.NormalModuleReplacementPlugin(/socket\.io-parser/, __dirname + '/src/socket-parser')
]
}