下面是我的webpack.config.jswebpack 版本为 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 */
Run Code Online (Sandbox Code Playgroud)
当尝试部署时,收到以下错误
[webpack-cli] Failed to load '/code/webpack.config.js' config
[webpack-cli] Invalid options object. Ignore Plugin has been initialized using an options …Run Code Online (Sandbox Code Playgroud)