2017-06-12 10:51:54 -05:00
|
|
|
/* eslint-env node */
|
|
|
|
const path = require('path');
|
|
|
|
const webpack = require('webpack');
|
|
|
|
|
|
|
|
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 = {
|
|
|
|
plugins: [
|
|
|
|
new webpack.ProvidePlugin({
|
|
|
|
jQuery: 'jquery',
|
|
|
|
_: 'underscore',
|
|
|
|
'underscore.string': 'underscore.string',
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.jsx?$/,
|
|
|
|
exclude: [/node_modules/, /vendor/],
|
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
2017-06-13 03:50:41 -05:00
|
|
|
presets: ['es2015', 'react'],
|
2017-06-12 10:51:54 -05:00
|
|
|
},
|
|
|
|
},
|
2017-06-23 03:35:56 -05:00
|
|
|
}, {
|
|
|
|
test: /\.css$/,
|
|
|
|
use: [ 'style-loader', 'raw-loader' ],
|
|
|
|
}, {
|
2017-06-12 10:51:54 -05:00
|
|
|
test: /.*slickgrid\/slick\.(?!core)*/,
|
|
|
|
loader: 'imports-loader?' +
|
|
|
|
'jquery.ui' +
|
|
|
|
',jquery.event.drag' +
|
|
|
|
',slickgrid',
|
|
|
|
}, {
|
2017-06-23 03:35:56 -05:00
|
|
|
test: /.*slickgrid\.plugins\/slick\.cellrangeselector/,
|
2017-06-12 10:51:54 -05:00
|
|
|
loader: 'imports-loader?' +
|
|
|
|
'jquery.ui' +
|
|
|
|
',jquery.event.drag' +
|
|
|
|
',slickgrid' +
|
|
|
|
'!exports-loader?' +
|
2017-06-23 03:35:56 -05:00
|
|
|
'Slick.CellRangeSelector',
|
2017-06-12 10:51:54 -05:00
|
|
|
}, {
|
|
|
|
test: /.*slickgrid\/slick\.core.*/,
|
|
|
|
loader: 'imports-loader?' +
|
|
|
|
'jquery.ui' +
|
|
|
|
',jquery.event.drag' +
|
|
|
|
'!exports-loader?' +
|
|
|
|
'Slick',
|
|
|
|
}],
|
|
|
|
},
|
|
|
|
|
|
|
|
resolve: {
|
2017-06-13 03:50:41 -05:00
|
|
|
extensions: ['.js', '.jsx'],
|
2017-06-12 10:51:54 -05:00
|
|
|
alias: {
|
2017-07-18 09:13:16 -05:00
|
|
|
'jquery': path.join(__dirname, './node_modules/jquery/dist/jquery'),
|
|
|
|
'alertify': path.join(__dirname, './node_modules/alertifyjs/build/alertify'),
|
|
|
|
'jquery.event.drag': path.join(__dirname, './node_modules/slickgrid/lib/jquery.event.drag-2.2'),
|
|
|
|
'jquery.ui': path.join(__dirname, './node_modules/slickgrid/lib/jquery-ui-1.11.3'),
|
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',
|
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',
|
2017-06-12 10:51:54 -05:00
|
|
|
},
|
|
|
|
},
|
2017-06-13 03:50:41 -05:00
|
|
|
externals: {
|
|
|
|
'react/addons': true,
|
|
|
|
'react/lib/ReactContext': true,
|
|
|
|
'react/lib/ExecutionEnvironment': true,
|
|
|
|
'react-dom/test-utils': true,
|
|
|
|
'react-test-renderer/shallow': true,
|
|
|
|
},
|
2017-06-12 10:51:54 -05:00
|
|
|
};
|