代码拉取完成,页面将自动刷新
// eslint-disable-next-line @typescript-eslint/no-require-imports
const path = require('path');
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { IgnorePlugin } = require('webpack');
const {
swcDefaultsFactory,
// eslint-disable-next-line @typescript-eslint/no-require-imports
} = require('@nestjs/cli/lib/compiler/defaults/swc-defaults');
// eslint-disable-next-line @typescript-eslint/no-require-imports
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
/** @type { import('webpack').Configuration } */
module.exports = {
entry: './src/main',
externals: {},
module: {
rules: [
{
exclude: /node_modules/,
test: /\.ts$/,
use: {
loader: 'swc-loader',
options: swcDefaultsFactory().swcOptions,
},
},
],
},
node: {
__dirname: false,
__filename: false,
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist/'),
},
plugins: [
new IgnorePlugin({
checkResource(resource) {
const lazyImports = [
'@fastify/static',
'@fastify/view',
'@nestjs/microservices',
'@nestjs/microservices/microservices-module',
'@nestjs/platform-express',
'@nestjs/websockets/socket-module',
'amqp-connection-manager',
'amqplib',
'cache-manager',
'cache-manager/package.json',
'class-transformer/storage',
'hbs',
'ioredis',
'kafkajs',
'mqtt',
'nats',
];
if (!lazyImports.includes(resource)) {
return false;
}
try {
require.resolve(resource, { paths: [process.cwd()] });
} catch (err) {
return true;
}
return false;
},
}),
],
resolve: {
extensions: ['.js', '.json', '.ts'],
mainFields: ['main'],
plugins: [new TsconfigPathsPlugin({ configFile: 'tsconfig.json' })],
},
target: 'node',
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。