Here is the setup of my webpack.config.js
on a backend server running webpack version 5.21.1:
/* eslint-disable */
const path = require('path');
const webpack = require('webpack');
module.exports = {
target: 'node',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist'),
libraryTarget: 'commonjs2',
},
plugins: [new webpack.IgnorePlugin(/\.\/native/, /\/pg\//)],
};
/* eslint-enable */
However, during the deployment process, I encountered the following error:
[webpack-cli] Failed to load '/code/webpack.config.js' config
[webpack-cli] Invalid options object. Ignore Plugin has been initialized using an options object that does not match the API schema.
- options should be one of these:
object { resourceRegExp, contextRegExp? } | object { checkResource }
Details:
* options misses the property 'resourceRegExp'. Should be:
RegExp
-> A RegExp to test the request against.
* options misses the property 'checkResource'. Should be:
function
-> A filter function for resource and context.
make: *** [Makefile:8: build] Error 2
I would appreciate any guidance on how to resolve this issue. Thank you!