mirror of
https://github.com/dbgate/dbgate
synced 2024-11-14 15:56:49 +00:00
41 lines
786 B
JavaScript
41 lines
786 B
JavaScript
|
var webpack = require('webpack');
|
||
|
var path = require('path');
|
||
|
|
||
|
var config = {
|
||
|
context: __dirname + '/src/backend',
|
||
|
|
||
|
entry: {
|
||
|
app: './index.js',
|
||
|
},
|
||
|
target: 'node',
|
||
|
output: {
|
||
|
path: path.resolve(__dirname, 'dist'),
|
||
|
filename: 'backend.js',
|
||
|
libraryTarget: 'commonjs2',
|
||
|
},
|
||
|
|
||
|
// uncomment for disable minimalization
|
||
|
// optimization: {
|
||
|
// minimize: false,
|
||
|
// },
|
||
|
|
||
|
plugins: [
|
||
|
new webpack.IgnorePlugin({
|
||
|
checkResource(resource) {
|
||
|
const lazyImports = ['pg-native', 'uws'];
|
||
|
if (!lazyImports.includes(resource)) {
|
||
|
return false;
|
||
|
}
|
||
|
try {
|
||
|
require.resolve(resource);
|
||
|
} catch (err) {
|
||
|
return true;
|
||
|
}
|
||
|
return false;
|
||
|
},
|
||
|
}),
|
||
|
],
|
||
|
};
|
||
|
|
||
|
module.exports = config;
|