1 const path = require('path');
2 const webpack = require('webpack');
3 const autoprefixer = require('autoprefixer');
4 const CopyPlugin = require('copy-webpack-plugin');
5 const WebpackConcatPlugin = require('webpack-concat-files-plugin');
6 const MiniCssExtractPlugin = require('mini-css-extract-plugin');
7 const RtlCssPlugin = require('rtlcss-webpack-plugin');
9 const rootPath = path.resolve(__dirname, '');
10 const publicPath = path.resolve(__dirname, 'public');
12 const typeScriptErrorsToIgnore = [
13 5096, // TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.
19 devtool: 'source-map',
21 'chart': rootPath + '/js/src/chart.ts',
22 'codemirror/addon/lint/sql-lint': rootPath + '/js/src/codemirror/addon/lint/sql-lint.ts',
23 'console': { import: rootPath + '/js/src/console.ts', library: { name: 'Console', type: 'window', export: 'Console' } },
24 'datetimepicker': rootPath + '/js/src/datetimepicker.ts',
25 'database/central_columns': rootPath + '/js/src/database/central_columns.ts',
26 'database/events': rootPath + '/js/src/database/events.ts',
27 'database/multi_table_query': rootPath + '/js/src/database/multi_table_query.ts',
28 'database/operations': rootPath + '/js/src/database/operations.ts',
29 'database/query_generator': rootPath + '/js/src/database/query_generator.ts',
30 'database/routines': rootPath + '/js/src/database/routines.ts',
31 'database/search': rootPath + '/js/src/database/search.ts',
32 'database/structure': rootPath + '/js/src/database/structure.ts',
33 'database/tracking': rootPath + '/js/src/database/tracking.ts',
34 'designer/init': rootPath + '/js/src/designer/init.ts',
35 'drag_drop_import': rootPath + '/js/src/drag_drop_import.ts',
36 'error_report': rootPath + '/js/src/error_report.ts',
37 'export': rootPath + '/js/src/export.ts',
38 'export_output': rootPath + '/js/src/export_output.ts',
39 'gis_data_editor': rootPath + '/js/src/gis_data_editor.ts',
40 'home': rootPath + '/js/src/home.ts',
41 'import': rootPath + '/js/src/import.ts',
42 'jqplot/plugins/jqplot.byteFormatter': rootPath + '/js/src/jqplot/plugins/jqplot.byteFormatter.ts',
43 'jquery.sortable-table': rootPath + '/js/src/jquery.sortable-table.ts',
44 'main': rootPath + '/js/src/main.ts',
45 'makegrid': rootPath + '/js/src/makegrid.ts',
46 'menu_resizer': rootPath + '/js/src/menu_resizer.ts',
47 'multi_column_sort': rootPath + '/js/src/multi_column_sort.ts',
48 'name-conflict-fixes': rootPath + '/js/src/name-conflict-fixes.ts',
49 'normalization': rootPath + '/js/src/normalization.ts',
50 'replication': rootPath + '/js/src/replication.ts',
51 'server/databases': rootPath + '/js/src/server/databases.ts',
52 'server/plugins': rootPath + '/js/src/server/plugins.ts',
53 'server/privileges': rootPath + '/js/src/server/privileges.ts',
54 'server/status/monitor': rootPath + '/js/src/server/status/monitor.ts',
55 'server/status/processes': rootPath + '/js/src/server/status/processes.ts',
56 'server/status/queries': rootPath + '/js/src/server/status/queries.ts',
57 'server/status/variables': rootPath + '/js/src/server/status/variables.ts',
58 'server/user_groups': rootPath + '/js/src/server/user_groups.ts',
59 'server/variables': rootPath + '/js/src/server/variables.ts',
60 'setup/scripts': rootPath + '/js/src/setup/scripts.ts',
61 'shortcuts_handler': rootPath + '/js/src/shortcuts_handler.ts',
62 'sql': rootPath + '/js/src/sql.ts',
63 'table/change': rootPath + '/js/src/table/change.ts',
64 'table/chart': rootPath + '/js/src/table/chart.ts',
65 'table/find_replace': rootPath + '/js/src/table/find_replace.ts',
66 'table/gis_visualization': rootPath + '/js/src/table/gis_visualization.ts',
67 'table/operations': rootPath + '/js/src/table/operations.ts',
68 'table/relation': rootPath + '/js/src/table/relation.ts',
69 'table/select': rootPath + '/js/src/table/select.ts',
70 'table/structure': rootPath + '/js/src/table/structure.ts',
71 'table/tracking': rootPath + '/js/src/table/tracking.ts',
72 'table/zoom_plot_jqplot': rootPath + '/js/src/table/zoom_plot_jqplot.ts',
73 'transformations/image_upload': rootPath + '/js/src/transformations/image_upload.ts',
74 'transformations/json': rootPath + '/js/src/transformations/json.ts',
75 'transformations/json_editor': rootPath + '/js/src/transformations/json_editor.ts',
76 'transformations/sql_editor': rootPath + '/js/src/transformations/sql_editor.ts',
77 'transformations/xml': rootPath + '/js/src/transformations/xml.ts',
78 'transformations/xml_editor': rootPath + '/js/src/transformations/xml_editor.ts',
79 'triggers': rootPath + '/js/src/triggers.ts',
80 'u2f': rootPath + '/js/src/u2f.ts',
81 'validator-messages': rootPath + '/js/src/validator-messages.ts',
82 'webauthn': rootPath + '/js/src/webauthn.ts',
85 filename: '[name].js',
86 path: publicPath + '/js/dist',
89 runtimeChunk: 'single',
98 codemirror: 'CodeMirror',
104 exclude: /node_modules/,
106 { loader: 'babel-loader', options: { presets: ['@babel/preset-env'] } },
107 { loader: 'ts-loader', options: { ignoreDiagnostics: typeScriptErrorsToIgnore } },
112 exclude: /node_modules/,
113 use: { loader: 'babel-loader', options: { presets: ['@babel/preset-env'] } },
120 { from: rootPath + '/node_modules/codemirror/addon/hint/sql-hint.js', to: publicPath + '/js/vendor/codemirror/addon/hint/sql-hint.js' },
121 { from: rootPath + '/node_modules/codemirror/addon/hint/show-hint.css', to: publicPath + '/js/vendor/codemirror/addon/hint/show-hint.css' },
122 { from: rootPath + '/node_modules/codemirror/addon/hint/show-hint.js', to: publicPath + '/js/vendor/codemirror/addon/hint/show-hint.js' },
123 { from: rootPath + '/node_modules/codemirror/addon/runmode/runmode.js', to: publicPath + '/js/vendor/codemirror/addon/runmode/runmode.js' },
124 { from: rootPath + '/node_modules/codemirror/addon/lint/lint.css', to: publicPath + '/js/vendor/codemirror/addon/lint/lint.css' },
125 { from: rootPath + '/node_modules/codemirror/addon/lint/lint.js', to: publicPath + '/js/vendor/codemirror/addon/lint/lint.js' },
126 { from: rootPath + '/node_modules/codemirror/lib/codemirror.js', to: publicPath + '/js/vendor/codemirror/lib/codemirror.js' },
127 { from: rootPath + '/node_modules/codemirror/lib/codemirror.css', to: publicPath + '/js/vendor/codemirror/lib/codemirror.css' },
128 { from: rootPath + '/node_modules/codemirror/mode/sql/sql.js', to: publicPath + '/js/vendor/codemirror/mode/sql/sql.js' },
129 { from: rootPath + '/node_modules/codemirror/mode/javascript/javascript.js', to: publicPath + '/js/vendor/codemirror/mode/javascript/javascript.js' },
130 { from: rootPath + '/node_modules/codemirror/mode/xml/xml.js', to: publicPath + '/js/vendor/codemirror/mode/xml/xml.js' },
131 { from: rootPath + '/node_modules/codemirror/LICENSE', to: publicPath + '/js/vendor/codemirror/LICENSE', toType: 'file' },
132 { from: rootPath + '/node_modules/jquery/dist/jquery.min.js', to: publicPath + '/js/vendor/jquery/jquery.min.js' },
133 { from: rootPath + '/node_modules/jquery/dist/jquery.min.map', to: publicPath + '/js/vendor/jquery/jquery.min.map' },
134 { from: rootPath + '/node_modules/jquery/LICENSE.txt', to: publicPath + '/js/vendor/jquery/MIT-LICENSE.txt' },
135 { from: rootPath + '/node_modules/jquery-migrate/dist/jquery-migrate.min.js', to: publicPath + '/js/vendor/jquery/jquery-migrate.min.js' },
136 { from: rootPath + '/node_modules/jquery-migrate/dist/jquery-migrate.min.map', to: publicPath + '/js/vendor/jquery/jquery-migrate.min.map' },
137 { from: rootPath + '/node_modules/jquery-ui-dist/jquery-ui.min.js', to: publicPath + '/js/vendor/jquery/jquery-ui.min.js' },
138 { from: rootPath + '/node_modules/jquery-validation/dist/jquery.validate.min.js', to: publicPath + '/js/vendor/jquery/jquery.validate.min.js' },
139 { from: rootPath + '/node_modules/jquery-validation/dist/additional-methods.js', to: publicPath + '/js/vendor/jquery/additional-methods.js' },
140 { from: rootPath + '/node_modules/js-cookie/dist/js.cookie.min.js', to: publicPath + '/js/vendor/js.cookie.min.js' },
141 { from: rootPath + '/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js', to: publicPath + '/js/vendor/bootstrap/bootstrap.bundle.min.js' },
142 { from: rootPath + '/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js.map', to: publicPath + '/js/vendor/bootstrap/bootstrap.bundle.min.js.map' },
143 { from: rootPath + '/node_modules/@zxcvbn-ts/core/dist/zxcvbn-ts.js', to: publicPath + '/js/vendor/zxcvbn-ts.js' },
144 { from: rootPath + '/node_modules/@zxcvbn-ts/core/dist/zxcvbn-ts.js.map', to: publicPath + '/js/vendor/zxcvbn-ts.js.map' },
145 { from: rootPath + '/node_modules/tracekit/tracekit.js', to: publicPath + '/js/vendor/tracekit.js' },
146 { from: rootPath + '/node_modules/u2f-api-polyfill/u2f-api-polyfill.js', to: publicPath + '/js/vendor/u2f-api-polyfill.js' },
147 { from: rootPath + '/node_modules/jquery-uitablefilter/jquery.uitablefilter.js', to: publicPath + '/js/vendor/jquery/jquery.uitablefilter.js' },
148 { from: rootPath + '/node_modules/tablesorter/dist/js/jquery.tablesorter.js', to: publicPath + '/js/vendor/jquery/jquery.tablesorter.js' },
149 { from: rootPath + '/node_modules/jquery-ui-timepicker-addon/dist/jquery-ui-timepicker-addon.js', to: publicPath + '/js/vendor/jquery/jquery-ui-timepicker-addon.js' },
150 { from: rootPath + '/node_modules/ol/ol.css', to: publicPath + '/js/vendor/openlayers/theme/ol.css' },
151 { from: rootPath + '/node_modules/locutus.sprintf/src/php/strings/sprintf.browser.js', to: publicPath + '/js/vendor/sprintf.js' },
152 { from: rootPath + '/node_modules/updated-jqplot/build/plugins/jqplot.pieRenderer.js', to: publicPath + '/js/vendor/jqplot/plugins/jqplot.pieRenderer.js' },
153 { from: rootPath + '/node_modules/updated-jqplot/build/plugins/jqplot.barRenderer.js', to: publicPath + '/js/vendor/jqplot/plugins/jqplot.barRenderer.js' },
154 { from: rootPath + '/node_modules/updated-jqplot/build/plugins/jqplot.pointLabels.js', to: publicPath + '/js/vendor/jqplot/plugins/jqplot.pointLabels.js' },
155 { from: rootPath + '/node_modules/updated-jqplot/build/plugins/jqplot.enhancedPieLegendRenderer.js', to: publicPath + '/js/vendor/jqplot/plugins/jqplot.enhancedPieLegendRenderer.js' },
156 { from: rootPath + '/node_modules/updated-jqplot/build/plugins/jqplot.dateAxisRenderer.js', to: publicPath + '/js/vendor/jqplot/plugins/jqplot.dateAxisRenderer.js' },
157 { from: rootPath + '/node_modules/updated-jqplot/build/plugins/jqplot.categoryAxisRenderer.js', to: publicPath + '/js/vendor/jqplot/plugins/jqplot.categoryAxisRenderer.js' },
158 { from: rootPath + '/node_modules/updated-jqplot/build/plugins/jqplot.canvasTextRenderer.js', to: publicPath + '/js/vendor/jqplot/plugins/jqplot.canvasTextRenderer.js' },
159 { from: rootPath + '/node_modules/updated-jqplot/build/plugins/jqplot.canvasAxisLabelRenderer.js', to: publicPath + '/js/vendor/jqplot/plugins/jqplot.canvasAxisLabelRenderer.js' },
160 { from: rootPath + '/node_modules/updated-jqplot/build/plugins/jqplot.cursor.js', to: publicPath + '/js/vendor/jqplot/plugins/jqplot.cursor.js' },
161 { from: rootPath + '/node_modules/updated-jqplot/build/plugins/jqplot.highlighter.js', to: publicPath + '/js/vendor/jqplot/plugins/jqplot.highlighter.js' },
162 { from: rootPath + '/node_modules/chart.js/dist/chart.umd.js', to: publicPath + '/js/vendor/chart.umd.js' },
163 { from: rootPath + '/node_modules/chart.js/dist/chart.umd.js.map', to: publicPath + '/js/vendor/chart.umd.js.map' },
166 new WebpackConcatPlugin({
169 dest: publicPath + '/js/vendor/jqplot/jquery.jqplot.js',
171 rootPath + '/node_modules/updated-jqplot/build/jqplot.core.js',
172 rootPath + '/node_modules/updated-jqplot/build/jqplot.axisLabelRenderer.js',
173 rootPath + '/node_modules/updated-jqplot/build/jqplot.axisTickRenderer.js',
174 rootPath + '/node_modules/updated-jqplot/build/jqplot.canvasGridRenderer.js',
175 rootPath + '/node_modules/updated-jqplot/build/jqplot.divTitleRenderer.js',
176 rootPath + '/node_modules/updated-jqplot/build/jqplot.linePattern.js',
177 rootPath + '/node_modules/updated-jqplot/build/jqplot.lineRenderer.js',
178 rootPath + '/node_modules/updated-jqplot/build/jqplot.linearAxisRenderer.js',
179 rootPath + '/node_modules/updated-jqplot/build/jqplot.linearTickGenerator.js',
180 rootPath + '/node_modules/updated-jqplot/build/jqplot.markerRenderer.js',
181 rootPath + '/node_modules/updated-jqplot/build/jqplot.shadowRenderer.js',
182 rootPath + '/node_modules/updated-jqplot/build/jqplot.shapeRenderer.js',
183 rootPath + '/node_modules/updated-jqplot/build/jqplot.tableLegendRenderer.js',
184 rootPath + '/node_modules/updated-jqplot/build/jqplot.themeEngine.js',
185 rootPath + '/node_modules/updated-jqplot/build/jqplot.toImage.js',
186 rootPath + '/node_modules/updated-jqplot/build/jsdate.js',
187 rootPath + '/node_modules/updated-jqplot/build/jqplot.sprintf.js',
188 rootPath + '/node_modules/updated-jqplot/build/jqplot.effects.core.js',
189 rootPath + '/node_modules/updated-jqplot/build/jqplot.effects.blind.js',
198 entry: rootPath + '/js/src/ol.mjs',
199 devtool: 'source-map',
203 maxEntrypointSize: 512000,
204 maxAssetSize: 512000,
207 path: publicPath + '/js/vendor/openlayers',
208 filename: 'OpenLayers.js',
210 libraryTarget: 'umd',
211 libraryExport: 'default',
214 new webpack.BannerPlugin({
215 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)',
225 devtool: 'source-map',
227 'themes/bootstrap/css/theme': publicPath + '/themes/bootstrap/scss/theme.scss',
228 'themes/metro/css/theme': publicPath + '/themes/metro/scss/theme.scss',
229 'themes/original/css/theme': publicPath + '/themes/original/scss/theme.scss',
230 'themes/pmahomme/css/theme': publicPath + '/themes/pmahomme/scss/theme.scss',
231 'setup/styles': publicPath + '/setup/scss/styles.scss',
234 filename: 'build/css/[name].js',
242 MiniCssExtractPlugin.loader,
244 loader: 'css-loader',
250 loader: 'postcss-loader',
253 plugins: [ autoprefixer() ],
263 new MiniCssExtractPlugin({
264 filename: '[name].css',
265 chunkFilename: '[id].css',
268 filename: '[name].rtl.css',