2020-03-14 08:54:34 +00:00
|
|
|
var webpack = require('webpack');
|
|
|
|
var path = require('path');
|
|
|
|
|
|
|
|
var config = {
|
|
|
|
context: __dirname + '/src',
|
|
|
|
|
|
|
|
entry: {
|
|
|
|
app: './index.js',
|
|
|
|
},
|
|
|
|
target: 'node',
|
2021-01-16 17:55:10 +00:00
|
|
|
node: {
|
|
|
|
__dirname: false,
|
2022-02-17 06:57:17 +00:00
|
|
|
},
|
2020-03-14 08:54:34 +00:00
|
|
|
output: {
|
|
|
|
path: path.resolve(__dirname, 'dist'),
|
2020-05-16 06:23:10 +00:00
|
|
|
filename: 'bundle.js',
|
2020-06-09 18:54:14 +00:00
|
|
|
libraryTarget: 'commonjs2',
|
2020-03-14 08:54:34 +00:00
|
|
|
},
|
2020-05-16 06:23:10 +00:00
|
|
|
|
2022-02-17 06:57:17 +00:00
|
|
|
// optimization: {
|
|
|
|
// minimize: false,
|
|
|
|
// },
|
2020-06-09 18:54:14 +00:00
|
|
|
|
2021-01-16 17:55:10 +00:00
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.node$/,
|
|
|
|
use: 'node-loader',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2020-03-14 08:54:34 +00:00
|
|
|
plugins: [
|
|
|
|
new webpack.IgnorePlugin({
|
|
|
|
checkResource(resource) {
|
2020-11-26 14:42:50 +00:00
|
|
|
const lazyImports = ['uws'];
|
2020-03-14 08:54:34 +00:00
|
|
|
if (!lazyImports.includes(resource)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
require.resolve(resource);
|
|
|
|
} catch (err) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
],
|
2022-02-17 06:57:17 +00:00
|
|
|
externals: {
|
2024-07-31 12:07:49 +00:00
|
|
|
'better-sqlite3': 'commonjs better-sqlite3',
|
|
|
|
'oracledb': 'commonjs oracledb',
|
|
|
|
'msnodesqlv8': 'commonjs msnodesqlv8',
|
2022-02-17 06:57:17 +00:00
|
|
|
},
|
2020-03-14 08:54:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = config;
|