-
Notifications
You must be signed in to change notification settings - Fork 4
/
webpack.config.js
85 lines (83 loc) · 1.98 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
83
84
85
const path = require('path');
const TerserPlugin = require("terser-webpack-plugin");
const CopyRenameWebpackPlugin = require("copy-rename-webpack-plugin");
module.exports = {
mode: 'production',
entry: {
iob: './lib/iob/index.js',
meal: './lib/meal/index.js',
"determineBasal": './lib/determine-basal/determine-basal.js',
"glucoseGetLast": './lib/glucose-get-last.js',
"basalSetTemp": './lib/basal-set-temp.js',
autosens: './lib/determine-basal/autosens.js',
profile: './lib/profile/index.js',
"autotunePrep": './lib/autotune-prep/index.js',
"autotuneCore": './lib/autotune/index.js'
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
libraryTarget: 'var',
library: 'freeaps_[name]'
},
optimization: {
minimize: true,
minimizer: [new TerserPlugin()],
},
plugins: [
new CopyRenameWebpackPlugin({
entry: "determineBasal.js",
output: [
"bundle/determine-basal.js"
],
}),
new CopyRenameWebpackPlugin({
entry: "glucoseGetLast.js",
output: [
"bundle/glucose-get-last.js"
],
}),
new CopyRenameWebpackPlugin({
entry: "basalSetTemp.js",
output: [
"bundle/basal-set-temp.js"
],
}),
new CopyRenameWebpackPlugin({
entry: "iob.js",
output: [
"bundle/iob.js"
],
}),
new CopyRenameWebpackPlugin({
entry: "meal.js",
output: [
"bundle/meal.js"
],
}),
new CopyRenameWebpackPlugin({
entry: "autosens.js",
output: [
"bundle/autosens.js"
],
}),
new CopyRenameWebpackPlugin({
entry: "profile.js",
output: [
"bundle/profile.js"
],
}),
new CopyRenameWebpackPlugin({
entry: "autotunePrep.js",
output: [
"bundle/autotune-prep.js"
],
}),
new CopyRenameWebpackPlugin({
entry: "autotuneCore.js",
output: [
"bundle/autotune-core.js"
],
}),
],
};