/
webpack.common.js
52 lines (49 loc) · 1.08 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
41
42
43
44
45
46
47
48
49
50
51
52
const path = require('path');
const pjson = require('./package.json')
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');
var entryPoints = {
'cidaas-javascript-sdk': './src/main/index.ts'
};
module.exports = {
entry: entryPoints,
module: {
rules: [
{
test: /\.ts?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.ts', '.js'],
},
optimization: {
minimizer: [new TerserPlugin({
extractComments: false,
})],
},
plugins: [
new webpack.BannerPlugin({
banner: `${pjson.name} v${pjson.version}\n\nAuthor: ${pjson.author}\nDate: ${new Date().toLocaleString()}\nLicense: MIT\n`, // eslint-disable-line
raw: false,
entryOnly: true
}
)
],
output: {
path: path.resolve(__dirname, './minified'),
filename: '[name].min.js',
library: 'CidaasSDK',
libraryTarget: 'umd',
umdNamedDefine: true,
clean: true,
globalObject: 'this'
},
stats: {
colors: true,
modules: true,
reasons: true
},
};