forked from phpmyadmin/phpmyadmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
270 lines (269 loc) · 18.7 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
const path = require('path');
const webpack = require('webpack');
const autoprefixer = require('autoprefixer');
const CopyPlugin = require('copy-webpack-plugin');
const WebpackConcatPlugin = require('webpack-concat-files-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const WebpackRTLPlugin = require('webpack-rtl-plugin');
module.exports = [
{
mode: 'none',
devtool: 'source-map',
entry: {
'ajax': './js/src/ajax.js',
'chart': './js/src/chart.js',
'codemirror/addon/lint/sql-lint': './js/src/codemirror/addon/lint/sql-lint.js',
'common': './js/src/common.js',
'config': './js/src/config.js',
'console': './js/src/console.js',
'cross_framing_protection': './js/src/cross_framing_protection.js',
'datetimepicker': './js/src/datetimepicker.js',
'database/central_columns': './js/src/database/central_columns.js',
'database/events': './js/src/database/events.js',
'database/multi_table_query': './js/src/database/multi_table_query.js',
'database/operations': './js/src/database/operations.js',
'database/qbe': './js/src/database/qbe.js',
'database/query_generator': './js/src/database/query_generator.js',
'database/routines': './js/src/database/routines.js',
'database/search': './js/src/database/search.js',
'database/structure': './js/src/database/structure.js',
'database/tracking': './js/src/database/tracking.js',
'database/triggers': './js/src/database/triggers.js',
'designer/database': './js/src/designer/database.js',
'designer/history': './js/src/designer/history.js',
'designer/init': './js/src/designer/init.js',
'designer/move': './js/src/designer/move.js',
'designer/objects': './js/src/designer/objects.js',
'designer/page': './js/src/designer/page.js',
'doclinks': './js/src/doclinks.js',
'drag_drop_import': './js/src/drag_drop_import.js',
'error_report': './js/src/error_report.js',
'export': './js/src/export.js',
'export_output': './js/src/export_output.js',
'functions': './js/src/functions.js',
'gis_data_editor': './js/src/gis_data_editor.js',
'home': './js/src/home.js',
'import': './js/src/import.js',
'indexes': './js/src/indexes.js',
'jqplot/plugins/jqplot.byteFormatter': './js/src/jqplot/plugins/jqplot.byteFormatter.js',
'jquery.sortable-table': './js/src/jquery.sortable-table.js',
'keyhandler': './js/src/keyhandler.js',
'makegrid': './js/src/makegrid.js',
'menu_resizer': './js/src/menu_resizer.js',
'multi_column_sort': './js/src/multi_column_sort.js',
'name-conflict-fixes': './js/src/name-conflict-fixes.js',
'navigation': './js/src/navigation.js',
'normalization': './js/src/normalization.js',
'page_settings': './js/src/page_settings.js',
'replication': './js/src/replication.js',
'server/databases': './js/src/server/databases.js',
'server/plugins': './js/src/server/plugins.js',
'server/privileges': './js/src/server/privileges.js',
'server/status/monitor': './js/src/server/status/monitor.js',
'server/status/processes': './js/src/server/status/processes.js',
'server/status/queries': './js/src/server/status/queries.js',
'server/status/sorter': './js/src/server/status/sorter.js',
'server/status/variables': './js/src/server/status/variables.js',
'server/user_groups': './js/src/server/user_groups.js',
'server/variables': './js/src/server/variables.js',
'setup/ajax': './js/src/setup/ajax.js',
'setup/scripts': './js/src/setup/scripts.js',
'shortcuts_handler': './js/src/shortcuts_handler.js',
'sql': './js/src/sql.js',
'table/change': './js/src/table/change.js',
'table/chart': './js/src/table/chart.js',
'table/find_replace': './js/src/table/find_replace.js',
'table/gis_visualization': './js/src/table/gis_visualization.js',
'table/operations': './js/src/table/operations.js',
'table/relation': './js/src/table/relation.js',
'table/select': './js/src/table/select.js',
'table/structure': './js/src/table/structure.js',
'table/tracking': './js/src/table/tracking.js',
'table/zoom_plot_jqplot': './js/src/table/zoom_plot_jqplot.js',
'transformations/image_upload': './js/src/transformations/image_upload.js',
'transformations/json': './js/src/transformations/json.js',
'transformations/json_editor': './js/src/transformations/json_editor.js',
'transformations/sql_editor': './js/src/transformations/sql_editor.js',
'transformations/xml': './js/src/transformations/xml.js',
'transformations/xml_editor': './js/src/transformations/xml_editor.js',
'u2f': './js/src/u2f.js',
'validator-messages': './js/src/validator-messages.js',
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'js/dist'),
iife: false,
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
},
},
},
],
},
plugins: [
new CopyPlugin({
patterns: [
{ from: path.resolve(__dirname, 'node_modules/codemirror/addon/hint/sql-hint.js'), to: path.resolve(__dirname, 'js/vendor/codemirror/addon/hint/sql-hint.js') },
{ from: path.resolve(__dirname, 'node_modules/codemirror/addon/hint/show-hint.css'), to: path.resolve(__dirname, 'js/vendor/codemirror/addon/hint/show-hint.css') },
{ from: path.resolve(__dirname, 'node_modules/codemirror/addon/hint/show-hint.js'), to: path.resolve(__dirname, 'js/vendor/codemirror/addon/hint/show-hint.js') },
{ from: path.resolve(__dirname, 'node_modules/codemirror/addon/runmode/runmode.js'), to: path.resolve(__dirname, 'js/vendor/codemirror/addon/runmode/runmode.js') },
{ from: path.resolve(__dirname, 'node_modules/codemirror/addon/lint/lint.css'), to: path.resolve(__dirname, 'js/vendor/codemirror/addon/lint/lint.css') },
{ from: path.resolve(__dirname, 'node_modules/codemirror/addon/lint/lint.js'), to: path.resolve(__dirname, 'js/vendor/codemirror/addon/lint/lint.js') },
{ from: path.resolve(__dirname, 'node_modules/codemirror/lib/codemirror.js'), to: path.resolve(__dirname, 'js/vendor/codemirror/lib/codemirror.js') },
{ from: path.resolve(__dirname, 'node_modules/codemirror/lib/codemirror.css'), to: path.resolve(__dirname, 'js/vendor/codemirror/lib/codemirror.css') },
{ from: path.resolve(__dirname, 'node_modules/codemirror/mode/sql/sql.js'), to: path.resolve(__dirname, 'js/vendor/codemirror/mode/sql/sql.js') },
{ from: path.resolve(__dirname, 'node_modules/codemirror/mode/javascript/javascript.js'), to: path.resolve(__dirname, 'js/vendor/codemirror/mode/javascript/javascript.js') },
{ from: path.resolve(__dirname, 'node_modules/codemirror/mode/xml/xml.js'), to: path.resolve(__dirname, 'js/vendor/codemirror/mode/xml/xml.js') },
{ from: path.resolve(__dirname, 'node_modules/codemirror/LICENSE'), to: path.resolve(__dirname, 'js/vendor/codemirror/LICENSE'), toType: 'file' },
{ from: path.resolve(__dirname, 'node_modules/jquery/dist/jquery.min.js'), to: path.resolve(__dirname, 'js/vendor/jquery/jquery.min.js') },
{ from: path.resolve(__dirname, 'node_modules/jquery/dist/jquery.min.map'), to: path.resolve(__dirname, 'js/vendor/jquery/jquery.min.map') },
{ from: path.resolve(__dirname, 'node_modules/jquery/LICENSE.txt'), to: path.resolve(__dirname, 'js/vendor/jquery/MIT-LICENSE.txt') },
{ from: path.resolve(__dirname, 'node_modules/jquery-migrate/dist/jquery-migrate.js'), to: path.resolve(__dirname, 'js/vendor/jquery/jquery-migrate.js') },
{ from: path.resolve(__dirname, 'node_modules/jquery-mousewheel/jquery.mousewheel.js'), to: path.resolve(__dirname, 'js/vendor/jquery/jquery.mousewheel.js') },
{ from: path.resolve(__dirname, 'node_modules/jquery-ui-dist/jquery-ui.min.js'), to: path.resolve(__dirname, 'js/vendor/jquery/jquery-ui.min.js') },
{ from: path.resolve(__dirname, 'node_modules/jquery-validation/dist/jquery.validate.js'), to: path.resolve(__dirname, 'js/vendor/jquery/jquery.validate.js') },
{ from: path.resolve(__dirname, 'node_modules/jquery-validation/dist/additional-methods.js'), to: path.resolve(__dirname, 'js/vendor/jquery/additional-methods.js') },
{ from: path.resolve(__dirname, 'node_modules/js-cookie/src/js.cookie.js'), to: path.resolve(__dirname, 'js/vendor/js.cookie.js') },
{ from: path.resolve(__dirname, 'node_modules/bootstrap/dist/js/bootstrap.bundle.min.js'), to: path.resolve(__dirname, 'js/vendor/bootstrap/bootstrap.bundle.min.js') },
{ from: path.resolve(__dirname, 'node_modules/bootstrap/dist/js/bootstrap.bundle.min.js.map'), to: path.resolve(__dirname, 'js/vendor/bootstrap/bootstrap.bundle.min.js.map') },
{ from: path.resolve(__dirname, 'node_modules/@zxcvbn-ts/core/dist/zxcvbn-ts.js'), to: path.resolve(__dirname, 'js/vendor/zxcvbn-ts.js') },
{ from: path.resolve(__dirname, 'node_modules/@zxcvbn-ts/core/dist/zxcvbn-ts.js.map'), to: path.resolve(__dirname, 'js/vendor/zxcvbn-ts.js.map') },
{ from: path.resolve(__dirname, 'node_modules/tracekit/tracekit.js'), to: path.resolve(__dirname, 'js/vendor/tracekit.js') },
{ from: path.resolve(__dirname, 'node_modules/u2f-api-polyfill/u2f-api-polyfill.js'), to: path.resolve(__dirname, 'js/vendor/u2f-api-polyfill.js') },
{ from: path.resolve(__dirname, 'node_modules/stickyfilljs/dist/stickyfill.min.js'), to: path.resolve(__dirname, 'js/vendor/stickyfill.min.js') },
{ from: path.resolve(__dirname, 'node_modules/kbwood-jquery-svg/jquery.svg.js'), to: path.resolve(__dirname, 'js/vendor/jquery/jquery.svg.js') },
{ from: path.resolve(__dirname, 'node_modules/jquery-uitablefilter/jquery.uitablefilter.js'), to: path.resolve(__dirname, 'js/vendor/jquery/jquery.uitablefilter.js') },
{ from: path.resolve(__dirname, 'node_modules/tablesorter/dist/js/jquery.tablesorter.js'), to: path.resolve(__dirname, 'js/vendor/jquery/jquery.tablesorter.js') },
{ from: path.resolve(__dirname, 'node_modules/jquery-debounce-throttle/index.js'), to: path.resolve(__dirname, 'js/vendor/jquery/jquery.debounce-1.0.6.js') },
{ from: path.resolve(__dirname, 'node_modules/jquery-ui-timepicker-addon/dist/jquery-ui-timepicker-addon.js'), to: path.resolve(__dirname, 'js/vendor/jquery/jquery-ui-timepicker-addon.js') },
{ from: path.resolve(__dirname, 'node_modules/ol/ol.css'), to: path.resolve(__dirname, 'js/vendor/openlayers/theme/ol.css') },
{ from: path.resolve(__dirname, 'node_modules/locutus.sprintf/src/php/strings/sprintf.browser.js'), to: path.resolve(__dirname, 'js/vendor/sprintf.js') },
{ from: path.resolve(__dirname, 'node_modules/updated-jqplot/build/plugins/jqplot.pieRenderer.js'), to: path.resolve(__dirname, 'js/vendor/jqplot/plugins/jqplot.pieRenderer.js') },
{ from: path.resolve(__dirname, 'node_modules/updated-jqplot/build/plugins/jqplot.barRenderer.js'), to: path.resolve(__dirname, 'js/vendor/jqplot/plugins/jqplot.barRenderer.js') },
{ from: path.resolve(__dirname, 'node_modules/updated-jqplot/build/plugins/jqplot.pointLabels.js'), to: path.resolve(__dirname, 'js/vendor/jqplot/plugins/jqplot.pointLabels.js') },
{ from: path.resolve(__dirname, 'node_modules/updated-jqplot/build/plugins/jqplot.enhancedPieLegendRenderer.js'), to: path.resolve(__dirname, 'js/vendor/jqplot/plugins/jqplot.enhancedPieLegendRenderer.js') },
{ from: path.resolve(__dirname, 'node_modules/updated-jqplot/build/plugins/jqplot.dateAxisRenderer.js'), to: path.resolve(__dirname, 'js/vendor/jqplot/plugins/jqplot.dateAxisRenderer.js') },
{ from: path.resolve(__dirname, 'node_modules/updated-jqplot/build/plugins/jqplot.categoryAxisRenderer.js'), to: path.resolve(__dirname, 'js/vendor/jqplot/plugins/jqplot.categoryAxisRenderer.js') },
{ from: path.resolve(__dirname, 'node_modules/updated-jqplot/build/plugins/jqplot.canvasTextRenderer.js'), to: path.resolve(__dirname, 'js/vendor/jqplot/plugins/jqplot.canvasTextRenderer.js') },
{ from: path.resolve(__dirname, 'node_modules/updated-jqplot/build/plugins/jqplot.canvasAxisLabelRenderer.js'), to: path.resolve(__dirname, 'js/vendor/jqplot/plugins/jqplot.canvasAxisLabelRenderer.js') },
{ from: path.resolve(__dirname, 'node_modules/updated-jqplot/build/plugins/jqplot.cursor.js'), to: path.resolve(__dirname, 'js/vendor/jqplot/plugins/jqplot.cursor.js') },
{ from: path.resolve(__dirname, 'node_modules/updated-jqplot/build/plugins/jqplot.highlighter.js'), to: path.resolve(__dirname, 'js/vendor/jqplot/plugins/jqplot.highlighter.js') },
],
}),
new WebpackConcatPlugin({
bundles: [
{
dest: './js/vendor/jqplot/jquery.jqplot.js',
src: [
'./node_modules/updated-jqplot/build/jqplot.core.js',
'./node_modules/updated-jqplot/build/jqplot.axisLabelRenderer.js',
'./node_modules/updated-jqplot/build/jqplot.axisTickRenderer.js',
'./node_modules/updated-jqplot/build/jqplot.canvasGridRenderer.js',
'./node_modules/updated-jqplot/build/jqplot.divTitleRenderer.js',
'./node_modules/updated-jqplot/build/jqplot.linePattern.js',
'./node_modules/updated-jqplot/build/jqplot.lineRenderer.js',
'./node_modules/updated-jqplot/build/jqplot.linearAxisRenderer.js',
'./node_modules/updated-jqplot/build/jqplot.linearTickGenerator.js',
'./node_modules/updated-jqplot/build/jqplot.markerRenderer.js',
'./node_modules/updated-jqplot/build/jqplot.shadowRenderer.js',
'./node_modules/updated-jqplot/build/jqplot.shapeRenderer.js',
'./node_modules/updated-jqplot/build/jqplot.tableLegendRenderer.js',
'./node_modules/updated-jqplot/build/jqplot.themeEngine.js',
'./node_modules/updated-jqplot/build/jqplot.toImage.js',
'./node_modules/updated-jqplot/build/jsdate.js',
'./node_modules/updated-jqplot/build/jqplot.sprintf.js',
'./node_modules/updated-jqplot/build/jqplot.effects.core.js',
'./node_modules/updated-jqplot/build/jqplot.effects.blind.js',
],
},
],
}),
],
},
{
name: 'OpenLayers',
entry: './js/src/ol.mjs',
devtool: 'source-map',
mode: 'production',
performance: {
hints: false,
maxEntrypointSize: 512000,
maxAssetSize: 512000,
},
output: {
path: path.resolve('./js/vendor/openlayers'),
filename: 'OpenLayers.js',
library: 'ol',
libraryTarget: 'umd',
libraryExport: 'default',
},
plugins: [
new webpack.BannerPlugin({
banner: 'OpenLayers (https://openlayers.org/)\nCopyright 2005-present, OpenLayers Contributors All rights reserved.\nLicensed under BSD 2-Clause License (https://github.com/openlayers/openlayers/blob/main/LICENSE.md)',
}),
],
},
{
name: 'CSS',
mode: 'none',
devtool: 'source-map',
entry: {
'themes/bootstrap/css/theme': './themes/bootstrap/scss/theme.scss',
'themes/metro/css/blueeyes-theme': './themes/metro/scss/blueeyes-theme.scss',
'themes/metro/css/mono-theme': './themes/metro/scss/mono-theme.scss',
'themes/metro/css/redmond-theme': './themes/metro/scss/redmond-theme.scss',
'themes/metro/css/teal-theme': './themes/metro/scss/teal-theme.scss',
'themes/metro/css/theme': './themes/metro/scss/theme.scss',
'themes/original/css/theme': './themes/original/scss/theme.scss',
'themes/pmahomme/css/theme': './themes/pmahomme/scss/theme.scss',
'setup/styles': './setup/scss/styles.scss',
},
output: {
filename: 'build/css/[name].js',
path: path.resolve(__dirname, ''),
},
module: {
rules: [
{
test: /\.scss$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: {
url: false,
},
},
{
loader: 'postcss-loader',
options: {
postcssOptions: {
plugins: [ autoprefixer() ],
},
},
},
'sass-loader',
],
},
],
},
plugins: [
new MiniCssExtractPlugin({
filename: '[name].css',
chunkFilename: '[id].css',
}),
new WebpackRTLPlugin({
filename: '[name].rtl.css',
minify: false,
}),
],
},
];