-
Notifications
You must be signed in to change notification settings - Fork 21
/
webpack.config.js
143 lines (142 loc) · 3.83 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
mode: 'development',
entry: {
home: './client/pages/users-home.js',
userSettings: './client/pages/user-settings.js',
quickstart: './client/pages/quickstart.js',
exampleLibrary: './client/pages/example-library.js',
browser: './client/pages/browser.js',
editor: './client/pages/model-editor.js',
domainEditor: './client/pages/domain-editor.js',
workflowSelection: './client/pages/workflow-selection.js',
workflowEditor: './client/pages/workflow-manager.js',
projectManager: './client/pages/project-manager.js',
loadingPage: './client/pages/loading-page.js',
multiplePlots: './client/pages/multiple-plots.js'
},
output: {
filename: 'stochss-[name].bundle.js',
path: path.resolve(__dirname, "stochss/dist")
},
devtool: 'inline-source-map',
plugins: [
new HtmlWebpackPlugin({
title: 'StochSS | Home',
filename: 'stochss-user-home.html',
template: 'page_template.pug',
name: 'home',
inject: false
}),
new HtmlWebpackPlugin({
title: 'StochSS | User Settings',
filename: 'stochss-user-settings.html',
template: 'page_template.pug',
name: 'userSettings',
inject: false
}),
new HtmlWebpackPlugin({
title: 'StochSS | Quickstart',
filename: 'stochss-quickstart.html',
template: 'page_template.pug',
name: 'quickstart',
inject: false
}),
new HtmlWebpackPlugin({
title: 'StochSS | Example Library',
filename: 'stochss-example-library.html',
template: 'page_template.pug',
name: 'exampleLibrary',
inject: false
}),
new HtmlWebpackPlugin({
title: 'StochSS | Model Browser',
filename: 'stochss-file-browser.html',
template: 'page_template.pug',
name: 'browser',
inject: false
}),
new HtmlWebpackPlugin({
title: 'StochSS | Model Editor',
filename: 'stochss-model-editor.html',
template: 'page_template.pug',
name: 'editor',
inject: false
}),
new HtmlWebpackPlugin({
title: 'StochSS | Domain Editor',
filename: 'stochss-domain-editor.html',
template: 'page_template.pug',
name: 'domainEditor',
inject: false
}),
new HtmlWebpackPlugin({
title: 'StochSS | Workflow Selection',
filename: 'stochss-workflow-selection.html',
template: 'page_template.pug',
name: 'workflowSelection',
inject: false
}),
new HtmlWebpackPlugin({
title: 'StochSS | Workflow Editor',
filename: 'stochss-workflow-manager.html',
template: 'page_template.pug',
name: 'workflowEditor',
inject: false
}),
new HtmlWebpackPlugin({
title: 'StochSS | Project Manager',
filename: 'stochss-project-manager.html',
template: 'page_template.pug',
name: 'projectManager',
inject: false
}),
new HtmlWebpackPlugin({
title: "StochSS | Loading Page",
filename: 'stochss-loading-page.html',
template: 'page_template.pug',
name: 'loadingPage',
inject: false
}),
new HtmlWebpackPlugin({
title: "StochSS | Multiple Plots Page",
filename: 'multiple-plots-page.html',
template: 'page_template.pug',
name: 'multiplePlots',
inject: false
})
],
optimization: {
splitChunks: {
cacheGroups: {
commons: {
name: 'common',
chunks: 'initial',
minChunks: 2
}
}
}
},
module: {
rules: [
{
test: /\.pug$/,
use: [ 'pug-loader' ]
},
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
]
},
{
test: /\.(png|svg|jpg|gif)$/,
use: [
'file-loader'
]
}
]
}
}