1 Star 0 Fork 0

科航传奇/许润卿-测报灯面板后端

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
webpack.config.js 2.05 KB
一键复制 编辑 原始数据 按行查看 历史
科航传奇 提交于 2024-10-21 12:30 . init
// 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',
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhanghang200/xu-runqing---tree-brand-back.git
[email protected]:zhanghang200/xu-runqing---tree-brand-back.git
zhanghang200
xu-runqing---tree-brand-back
许润卿-测报灯面板后端
master

搜索帮助