2019-01-02 04:24:12 -06:00
|
|
|
/////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
|
|
//
|
2021-01-04 04:04:45 -06:00
|
|
|
// Copyright (C) 2013 - 2021, The pgAdmin Development Team
|
2019-01-02 04:24:12 -06:00
|
|
|
// This software is released under the PostgreSQL Licence
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////
|
|
|
|
|
2017-06-12 10:51:54 -05:00
|
|
|
/* eslint-env node */
|
|
|
|
const path = require('path');
|
|
|
|
const webpack = require('webpack');
|
2021-02-10 01:17:52 -06:00
|
|
|
const ImageMinimizerPlugin = require('image-minimizer-webpack-plugin');
|
2017-06-12 10:51:54 -05:00
|
|
|
|
|
|
|
const sourcesDir = path.resolve(__dirname, 'pgadmin/static');
|
2017-06-23 03:35:56 -05:00
|
|
|
const nodeModulesDir = path.resolve(__dirname, 'node_modules');
|
2017-06-12 10:51:54 -05:00
|
|
|
const regressionDir = path.resolve(__dirname, 'regression');
|
|
|
|
|
|
|
|
module.exports = {
|
2020-01-15 06:37:46 -06:00
|
|
|
mode: 'development',
|
2018-05-30 21:09:00 -05:00
|
|
|
devtool: 'inline-source-map',
|
2017-06-12 10:51:54 -05:00
|
|
|
plugins: [
|
|
|
|
new webpack.ProvidePlugin({
|
|
|
|
jQuery: 'jquery',
|
|
|
|
_: 'underscore',
|
2018-01-25 06:49:06 -06:00
|
|
|
'window.jQuery': 'jquery',
|
2018-10-11 07:23:59 -05:00
|
|
|
'moment': 'moment',
|
|
|
|
'window.moment':'moment',
|
2021-02-10 01:17:52 -06:00
|
|
|
process: 'process/browser',
|
|
|
|
Buffer: ['buffer', 'Buffer'],
|
|
|
|
}),
|
|
|
|
new ImageMinimizerPlugin({
|
|
|
|
test: /\.(jpe?g|png|gif|svg)$/i,
|
|
|
|
minimizerOptions: {
|
|
|
|
// Lossless optimization with custom option
|
|
|
|
// Feel free to experiment with options for better result for you
|
|
|
|
plugins: [
|
|
|
|
['mozjpeg', { progressive: true }],
|
|
|
|
['optipng', { optimizationLevel: 7 }],
|
|
|
|
['pngquant', {quality: [0.75, .9], speed: 3}],
|
|
|
|
],
|
|
|
|
},
|
2017-06-12 10:51:54 -05:00
|
|
|
}),
|
|
|
|
],
|
|
|
|
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
2020-07-29 04:19:22 -05:00
|
|
|
test: /\.jsx?$/,
|
2017-06-12 10:51:54 -05:00
|
|
|
exclude: [/node_modules/, /vendor/],
|
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
2020-07-29 04:19:22 -05:00
|
|
|
presets: [['@babel/preset-env', {'modules': 'commonjs', 'useBuiltIns': 'usage', 'corejs': 3}], '@babel/preset-react'],
|
|
|
|
plugins: ['@babel/plugin-proposal-class-properties'],
|
2019-03-14 10:11:16 -05:00
|
|
|
sourceMap: 'inline',
|
2017-06-12 10:51:54 -05:00
|
|
|
},
|
|
|
|
},
|
2017-06-23 03:35:56 -05:00
|
|
|
}, {
|
|
|
|
test: /\.css$/,
|
2021-02-10 01:17:52 -06:00
|
|
|
type: 'asset/source',
|
|
|
|
use: ['style-loader'],
|
2021-01-29 00:49:24 -06:00
|
|
|
}, {
|
|
|
|
test: /\.(jpe?g|png|gif|svg)$/i,
|
2021-02-10 01:17:52 -06:00
|
|
|
type: 'asset',
|
|
|
|
parser: {
|
|
|
|
dataUrlCondition: {
|
|
|
|
maxSize: 4 * 1024, // 4kb
|
2021-01-29 00:49:24 -06:00
|
|
|
},
|
2021-02-10 01:17:52 -06:00
|
|
|
},
|
|
|
|
generator: {
|
|
|
|
filename: 'img/[name].[ext]',
|
|
|
|
},
|
2021-01-29 00:49:24 -06:00
|
|
|
exclude: /vendor/,
|
2017-06-23 03:35:56 -05:00
|
|
|
}, {
|
2018-05-11 04:23:37 -05:00
|
|
|
test: /.*slickgrid[\\\/]+slick\.(?!core)*/,
|
2021-02-10 01:17:52 -06:00
|
|
|
use:[
|
|
|
|
{
|
|
|
|
loader: 'imports-loader',
|
|
|
|
options: {
|
|
|
|
type: 'commonjs',
|
|
|
|
imports: [
|
|
|
|
'pure|jquery.ui',
|
|
|
|
'pure|jquery.event.drag',
|
|
|
|
'pure|slickgrid',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2017-06-12 10:51:54 -05:00
|
|
|
}, {
|
2018-05-11 04:23:37 -05:00
|
|
|
test: /.*slickgrid\.plugins[\\\/]+slick\.cellrangeselector/,
|
2021-02-10 01:17:52 -06:00
|
|
|
use:[
|
|
|
|
{
|
|
|
|
loader: 'imports-loader',
|
|
|
|
options: {
|
|
|
|
type: 'commonjs',
|
|
|
|
imports: [
|
|
|
|
'pure|jquery.ui',
|
|
|
|
'pure|jquery.event.drag',
|
|
|
|
'pure|slickgrid',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}, {
|
|
|
|
loader: 'exports-loader',
|
|
|
|
options: {
|
|
|
|
type: 'commonjs',
|
|
|
|
exports: 'single|Slick.CellRangeSelector',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2017-06-12 10:51:54 -05:00
|
|
|
}, {
|
2018-05-11 04:23:37 -05:00
|
|
|
test: /.*slickgrid[\\\/]+slick\.core.*/,
|
2021-02-10 01:17:52 -06:00
|
|
|
use:[
|
|
|
|
{
|
|
|
|
loader: 'imports-loader',
|
|
|
|
options: {
|
|
|
|
type: 'commonjs',
|
|
|
|
imports: [
|
|
|
|
'pure|jquery.ui',
|
|
|
|
'pure|jquery.event.drag',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}, {
|
|
|
|
loader: 'exports-loader',
|
|
|
|
options: {
|
|
|
|
type: 'commonjs',
|
|
|
|
exports: 'single|Slick',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2020-08-07 01:57:12 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.js$|\.jsx$/,
|
|
|
|
use: {
|
|
|
|
loader: 'istanbul-instrumenter-loader',
|
|
|
|
options: { esModules: true },
|
|
|
|
},
|
|
|
|
enforce: 'post',
|
|
|
|
exclude: /node_modules|slickgrid|plugins|bundle|generated|regression|[Tt]est.js|[Ss]pecs.js|[Ss]pec.js|\.spec\.js$/,
|
|
|
|
},
|
|
|
|
],
|
2017-06-12 10:51:54 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
resolve: {
|
2020-07-29 04:19:22 -05:00
|
|
|
extensions: ['.js', '.jsx'],
|
2017-06-12 10:51:54 -05:00
|
|
|
alias: {
|
2018-09-05 11:25:11 -05:00
|
|
|
'top': path.join(__dirname, './pgadmin'),
|
2017-07-18 09:13:16 -05:00
|
|
|
'jquery': path.join(__dirname, './node_modules/jquery/dist/jquery'),
|
2019-05-31 10:51:30 -05:00
|
|
|
'wcdocker': path.join(__dirname, './node_modules/webcabin-docker/Build/wcDocker'),
|
2017-07-18 09:13:16 -05:00
|
|
|
'alertify': path.join(__dirname, './node_modules/alertifyjs/build/alertify'),
|
2018-05-10 01:54:52 -05:00
|
|
|
'jquery.event.drag': path.join(__dirname, './node_modules/slickgrid/lib/jquery.event.drag-2.3.0'),
|
2017-07-18 09:13:16 -05:00
|
|
|
'jquery.ui': path.join(__dirname, './node_modules/slickgrid/lib/jquery-ui-1.11.3'),
|
2020-04-03 06:36:47 -05:00
|
|
|
'color-picker': path.join(__dirname, './node_modules/@simonwep/pickr/dist/pickr.min'),
|
2018-01-25 06:49:06 -06:00
|
|
|
'bignumber': path.join(__dirname, './node_modules/bignumber.js/bignumber'),
|
2018-10-11 07:23:59 -05:00
|
|
|
'bootstrap.datetimepicker': path.join(__dirname, './node_modules/tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.min'),
|
2021-02-10 01:17:52 -06:00
|
|
|
'bootstrap.toggle': path.join(__dirname, './node_modules/bootstrap4-toggle/js/bootstrap4-toggle.min'),
|
2018-01-25 06:49:06 -06:00
|
|
|
'backbone': path.join(__dirname, './node_modules/backbone/backbone'),
|
|
|
|
'backform': path.join(__dirname, './node_modules/backform/src/backform'),
|
2019-10-10 01:35:28 -05:00
|
|
|
'backgrid': path.join(__dirname, './pgadmin/static/vendor/backgrid/backgrid'),
|
Improvement in the look and feel of the whole application
Changed the SCSS/CSS for the below third party libraries to adopt the
new look 'n' feel:
- wcDocker
- Alertify dialogs, and notifications
- AciTree
- Bootstrap Navbar
- Bootstrap Tabs
- Bootstrap Drop-Down menu
- Backgrid
- Select2
Adopated the new the look 'n' feel for the dialogs, wizard, properties,
tab panels, tabs, fieldset, subnode control, spinner control, HTML
table, and other form controls.
- Font is changed to Roboto
- Using SCSS variables to define the look 'n' feel
- Designer background images for the Login, and Forget password pages in
'web' mode
- Improved the look 'n' feel for the key selection in the preferences
dialog
- Table classes consistency changes across the application
- File Open and Save dialog list view changes
Author(s): Aditya Toshniwal & Khushboo Vashi
2018-12-21 05:44:55 -06:00
|
|
|
'backgrid.filter': path.join(__dirname, './node_modules/backgrid-filter/backgrid-filter'),
|
2017-06-12 10:51:54 -05:00
|
|
|
'sources': sourcesDir + '/js',
|
|
|
|
'translations': regressionDir + '/javascript/fake_translations',
|
|
|
|
'pgadmin.browser.endpoints': regressionDir + '/javascript/fake_endpoints',
|
2017-06-23 03:35:56 -05:00
|
|
|
'slickgrid': nodeModulesDir + '/slickgrid/',
|
|
|
|
'slickgrid.plugins': nodeModulesDir + '/slickgrid/plugins/',
|
|
|
|
'slickgrid.grid': nodeModulesDir + '/slickgrid/slick.grid',
|
2018-10-11 07:23:59 -05:00
|
|
|
'moment': path.join(__dirname, './node_modules/moment/moment'),
|
2017-06-12 10:51:54 -05:00
|
|
|
'browser': path.resolve(__dirname, 'pgadmin/browser/static/js'),
|
|
|
|
'pgadmin': sourcesDir + '/js/pgadmin',
|
2017-07-18 09:13:16 -05:00
|
|
|
'pgadmin.sqlfoldcode': sourcesDir + '/js/codemirror/addon/fold/pgadmin-sqlfoldcode',
|
2017-07-31 08:29:44 -05:00
|
|
|
'pgadmin.alertifyjs': sourcesDir + '/js/alertify.pgadmin.defaults',
|
2018-01-25 06:49:06 -06:00
|
|
|
'pgadmin.backgrid': sourcesDir + '/js/backgrid.pgadmin',
|
|
|
|
'pgadmin.backform': sourcesDir + '/js/backform.pgadmin',
|
2018-06-05 05:36:19 -05:00
|
|
|
'pgbrowser': path.resolve(__dirname, 'regression/javascript/fake_browser'),
|
|
|
|
'pgadmin.schema.dir': path.resolve(__dirname, 'pgadmin/browser/server_groups/servers/databases/schemas/static/js'),
|
2019-05-31 10:51:30 -05:00
|
|
|
'pgadmin.browser.layout': path.join(__dirname, './pgadmin/browser/static/js/layout'),
|
2018-07-05 05:38:43 -05:00
|
|
|
'pgadmin.browser.preferences': path.join(__dirname, './pgadmin/browser/static/js/preferences'),
|
2020-01-15 06:37:46 -06:00
|
|
|
'pgadmin.browser.activity': path.join(__dirname, './pgadmin/browser/static/js/activity'),
|
2021-01-16 05:36:50 -06:00
|
|
|
'pgadmin.tools.erd': path.join(__dirname, './pgadmin/tools/erd/static/js'),
|
2021-05-25 09:42:57 -05:00
|
|
|
'pgadmin.tools.psql': path.join(__dirname, './pgadmin/tools/psql/static/js'),
|
2019-03-07 04:51:59 -06:00
|
|
|
'bundled_codemirror': path.join(__dirname, './pgadmin/static/bundle/codemirror'),
|
2020-04-06 07:03:07 -05:00
|
|
|
'tools': path.join(__dirname, './pgadmin/tools/'),
|
2021-05-05 01:10:48 -05:00
|
|
|
'pgadmin.user_management.current_user': regressionDir + '/javascript/fake_current_user',
|
|
|
|
'pgadmin.browser.constants': regressionDir + '/javascript/fake_constants',
|
2017-06-12 10:51:54 -05:00
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|