Files
dbgate/plugins/dbgate-plugin-oracle/webpack-backend.config.js
SPRINX0\prochazka 1f868523b0 NPM plugin refactor
2024-11-13 10:31:01 +01:00

47 lines
933 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 = ['uws'];
if (!lazyImports.includes(resource)) {
return false;
}
try {
require.resolve(resource);
} catch (err) {
return true;
}
return false;
},
}),
],
externals: {
'dbgate-tools': 'commonjs dbgate-tools',
'dbgate-query-splitter': 'commonjs dbgate-query-splitter',
lodash: 'commonjs lodash',
},
};
module.exports = config;