-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.prod.mjs
More file actions
65 lines (59 loc) · 1.33 KB
/
webpack.config.prod.mjs
File metadata and controls
65 lines (59 loc) · 1.33 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
import {merge} from 'webpack-merge';
import TerserPlugin from 'terser-webpack-plugin';
import common from './webpack.config.common.mjs';
const commonProd = {
mode: 'production',
devtool: 'source-map',
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
minify: TerserPlugin.uglifyJsMinify,
}),
],
},
}
const iifeFormat = merge(common, commonProd, {
output: {
filename: 'mastercard-connect-components-iife.min.js',
clean: false,
library: {
name: 'ConnectComponents',
type: 'var',
},
},
});
const ESMFormat = merge(common, commonProd, {
experiments: {
outputModule: true,
},
output: {
filename: 'mastercard-connect-components-esm.min.js',
clean: false,
module: true,
library: {
type: 'module'
},
},
});
const commonJSFormat = merge(common, commonProd, {
output: {
filename: 'mastercard-connect-components-cjs.min.js',
clean: false,
library: {
name: 'Connect-Components-Web-SDK',
type: 'commonjs2'
}
},
});
const UMDFormat = merge(common, commonProd, {
output: {
filename: 'mastercard-connect-components-umd.min.js',
clean: false,
library: {
name: 'Connect-Components-Web-SDK',
type: 'umd2'
}
},
});
export default [ESMFormat, commonJSFormat, iifeFormat, UMDFormat];