-
Notifications
You must be signed in to change notification settings - Fork 36
/
webpack.common.js
40 lines (36 loc) · 1.06 KB
/
webpack.common.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
module.exports = {
entry: {
split: ['./esm/umd.js']
},
output: {
path: __dirname + '/umd',
library: 'splitio',
libraryTarget: 'umd',
libraryExport: 'default'
},
devtool: false, // Remove source mapping. 'eval' is used by default in Webpack 5
module: {
rules: [
{
test: /\.(ts|js)$/,
exclude: /node_modules/,
use: {
loader: 'ts-loader'
}
/*
// Use next configuration to bundle from entry './src/umd.js'
exclude: /node_modules[/](?!@splitsoftware)/, // Cannot exclude 'node_modules/@splitsoftware/splitio-commons/src', in order to process TS files
use: {
loader: 'ts-loader',
options: { allowTsInNodeModules: true } // https://github.com/TypeStrong/ts-loader#allowtsinnodemodules
}
*/
}
]
},
resolve: {
extensions: ['.ts', '.js']
},
node: false, // Not include Node polyfills, https://webpack.js.org/configuration/node
target: ['web', 'es5'], // target 'es5', since 'es2015' is the default in Webpack 5
};