forked from Sunbird-Ed/sunbird-client-services
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
69 lines (66 loc) · 2.71 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
const path = require('path');
const UglifyJsPlugin = require('uglifyjs-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/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',
},
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: {
minimizer: [new UglifyJsPlugin({
sourceMap: true
})],
},
performance: {
hints: false
}
};
module.exports = (env, argv) => {
if (argv.mode === 'development') {
config.devtool = 'source-map';
}
return config;
};