-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.config.js
52 lines (50 loc) · 1.03 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');
var babelOptions = {
presets: [
['@babel/preset-env', { modules: 'commonjs', targets: {ie: 11} }]
],
plugins: [
['@babel/transform-runtime', { corejs: 3, absoluteRuntime: true }]
]
};
module.exports = {
mode: 'production',
entry: './src/index.ts',
output: {
filename: 'bundle.legacy.js',
path: path.resolve(__dirname, 'dist'),
library: {
type: 'umd'
}
},
module: {
rules: [
{
test: /\.(js|ts)$/,
exclude: /node_modules\/(?!cross-fetch).*/,
use: [
{ loader: 'babel-loader', options: babelOptions },
]
},
{
test: /\.ts$/,
exclude: '/node_modules/',
use: [
{ loader: 'ts-loader' , options: { configFile: 'tsconfig.esm.json' }}
]
},
],
},
resolve: {
extensions: [ '.ts', '.js' ],
},
performance: {
maxEntrypointSize: 400000,
maxAssetSize: 400000
},
devtool: 'source-map',
target: ['web', 'es5'],
optimization: {
minimize: false
},
};