-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathwebpack.config.cjs
More file actions
37 lines (35 loc) · 892 Bytes
/
webpack.config.cjs
File metadata and controls
37 lines (35 loc) · 892 Bytes
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
const path = require('path');
const TerserPlugin = require('terser-webpack-plugin');
const base = {
entry: path.resolve(__dirname, 'src/sdk.ts'),
mode: 'production',
target: ['web', 'es2020'],
devtool: 'source-map',
module: {
parser: { javascript: { url: false } },
rules: [
{ test: /\.ts$/, use: 'ts-loader', exclude: /node_modules/ },
],
},
resolve: {
extensions: ['.ts', '.js', '.json'],
extensionAlias: { '.js': ['.ts', '.js'] },
},
optimization: {
splitChunks: false,
runtimeChunk: false,
minimize: true,
minimizer: [new TerserPlugin({ terserOptions: { keep_classnames: true } })],
},
};
const esm = {
...base,
experiments: { outputModule: true },
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'evo-sdk.module.js',
library: { type: 'module' },
module: true,
},
};
module.exports = esm;