-
Notifications
You must be signed in to change notification settings - Fork 38
/
webpack.config.js
82 lines (79 loc) · 3.47 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
const path = require('path');
const TerserPlugin = require('terser-webpack-plugin');
const config = {
entry: {
'dist/index': './src/index.ts',
'dist/core/index': './src/core/index.ts',
'dist/core/http-service/index': './src/core/http-service/index.ts',
'dist/core/http-service/utilities/interceptors/index': './src/core/http-service/utilities/interceptors/index.ts',
'dist/models/index': './src/models/index.ts',
'dist/models/channel/index': './src/models/channel/index.ts',
'dist/models/content/index': './src/models/content/index.ts',
'dist/models/course/index': './src/models/course/index.ts',
'dist/models/device/index': './src/models/device/index.ts',
'dist/models/faq/index': './src/models/faq/index.ts',
'dist/models/form/index': './src/models/form/index.ts',
'dist/models/group/index': './src/models/group/index.ts',
'dist/models/location/index': './src/models/location/index.ts',
'dist/models/organisation/index': './src/models/organisation/index.ts',
'dist/models/page/index': './src/models/page/index.ts',
'dist/models/user/index': './src/models/user/index.ts',
'dist/services/content/index': './src/services/content/index.ts',
'dist/services/content/utilities/content-group-generator/index': './src/services/content/utilities/content-group-generator/index.ts',
'dist/services/content/utilities/content-progress-calculator/index': './src/services/content/utilities/content-progress-calculator/index.ts',
'dist/services/content/utilities/mime-type-facet-to-mime-type-category-aggregator/index': './src/services/content/utilities/mime-type-facet-to-mime-type-category-aggregator/index.ts',
'dist/services/content/utilities/primary-category-mapper/index': './src/services/content/utilities/primary-category-mapper/index.ts',
'dist/services/group/index': './src/services/group/index.ts',
'dist/services/group/activity/index': './src/services/group/activity/index.ts',
'dist/services/location/index': './src/services/location/index.ts',
'dist/services/framework/index': './src/services/framework/index.ts',
'dist/services/course/index': './src/services/course/index.ts',
'dist/services/user/index': './src/services/user/index.ts',
'dist/services/system-settings/index': './src/services/system-settings/index.ts',
'dist/blocs/index': './src/blocs/index.ts',
'dist/utilities/aggregator/index': './src/utilities/aggregator/index.ts',
'dist/telemetry/index': './src/telemetry/index.ts',
},
externals: [
// externals here
],
output: {
filename: '[name].js',
path: path.resolve(__dirname),
libraryTarget: 'umd'
},
mode: 'production',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
}
]
},
resolve: {
extensions: ['.tsx', '.ts', '.js']
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
compress: {
unused: false
}
}
})
],
},
performance: {
hints: false
}
};
module.exports = (env, argv) => {
if (argv.mode === 'development') {
config.devtool = 'source-map';
}
return config;
};