use webpack-node-externals in server build

This commit is contained in:
agatha 2024-04-12 20:04:31 -04:00
parent 6f3b1e5b3f
commit 510f1c81dd

View File

@ -1,6 +1,7 @@
const path = require('path'); const path = require('path');
const merge = require('webpack-merge'); const merge = require('webpack-merge');
const baseConfig = require('./webpack.base.js') const baseConfig = require('./webpack.base.js');
const webpackNodeExternals = require('webpack-node-externals');
const config = { const config = {
target: 'node', target: 'node',
@ -8,7 +9,9 @@ const config = {
output: { output: {
filename: 'bundle.js', filename: 'bundle.js',
path: path.resolve(__dirname, 'build') path: path.resolve(__dirname, 'build')
} },
externals: [webpackNodeExternals()]
}; };
module.exports = merge(baseConfig, config); module.exports = merge(baseConfig, config);