mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 12:13:57 +00:00
56 lines
1009 B
JavaScript
56 lines
1009 B
JavaScript
var webpack = require('webpack');
|
|
var path = require('path');
|
|
|
|
var config = {
|
|
context: __dirname + '/src',
|
|
|
|
entry: {
|
|
app: './index.js',
|
|
},
|
|
target: 'node',
|
|
node: {
|
|
__dirname: false,
|
|
},
|
|
output: {
|
|
path: path.resolve(__dirname, 'dist'),
|
|
filename: 'bundle.js',
|
|
libraryTarget: 'commonjs2',
|
|
},
|
|
|
|
// optimization: {
|
|
// minimize: false,
|
|
// },
|
|
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.node$/,
|
|
use: 'node-loader',
|
|
},
|
|
],
|
|
},
|
|
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: {
|
|
'better-sqlite3': 'commonjs better-sqlite3',
|
|
'oracledb': 'commonjs oracledb',
|
|
'msnodesqlv8': 'commonjs msnodesqlv8',
|
|
},
|
|
};
|
|
|
|
module.exports = config;
|