Title: nestjs使用rspack编译无法热更新 · Issue #291 · rstackjs/rstack-examples · GitHub
Open Graph Title: nestjs使用rspack编译无法热更新 · Issue #291 · rstackjs/rstack-examples
X Title: nestjs使用rspack编译无法热更新 · Issue #291 · rstackjs/rstack-examples
Description: 按照nestjs项目示例配置热更新,无法生效 使用的是@nestjs/platform-fastify框架 rspack配置如下: const { join, resolve } = require('path'); const { rspack } = require('@rspack/core'); const nodeExternals = require('webpack-node-externals'); const { RunScriptWebpackPlu...
Open Graph Description: 按照nestjs项目示例配置热更新,无法生效 使用的是@nestjs/platform-fastify框架 rspack配置如下: const { join, resolve } = require('path'); const { rspack } = require('@rspack/core'); const nodeExternals = require('webpack-node-...
X Description: 按照nestjs项目示例配置热更新,无法生效 使用的是@nestjs/platform-fastify框架 rspack配置如下: const { join, resolve } = require('path'); const { rspack } = require('@rspack/core'); const nodeExternals = requir...
Opengraph URL: https://github.com/rstackjs/rstack-examples/issues/291
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"nestjs使用rspack编译无法热更新","articleBody":"按照nestjs项目示例配置热更新,无法生效\n\n使用的是@nestjs/platform-fastify框架\nrspack配置如下:\n```\nconst { join, resolve } = require('path');\nconst { rspack } = require('@rspack/core');\nconst nodeExternals = require('webpack-node-externals');\nconst { RunScriptWebpackPlugin } = require('run-script-webpack-plugin');\nconst { TsCheckerRspackPlugin } = require('ts-checker-rspack-plugin');\n\nconst config = {\n context: __dirname,\n mode: 'development',\n target: 'node',\n devtool: 'inline-source-map',\n entry: {\n main: ['@rspack/core/hot/poll?100', './src/main.ts'],\n },\n output: {\n devtoolModuleFilenameTemplate: (info) =\u003e {\n return resolve(info.absoluteResourcePath);\n },\n path: join(__dirname, 'dist'),\n filename: 'main.js',\n library: {\n type: 'commonjs2',\n },\n clean: true,\n },\n externals: [\n nodeExternals({\n allowlist: ['@rspack/core/hot/poll?100'],\n }),\n ],\n resolve: {\n extensions: ['.tsx', '.ts', '.js', '.json', '.node'],\n tsConfig: {\n configFile: resolve('tsconfig.json'),\n },\n },\n module: {\n rules: [\n {\n test: /\\.node$/,\n loader: 'node-loader',\n options: {\n name: '[path][name].[ext]',\n },\n },\n {\n test: /\\.tsx?$/,\n exclude: /node_modules/,\n loader: 'builtin:swc-loader',\n options: {\n sourceMaps: true,\n jsc: {\n parser: {\n syntax: 'typescript',\n tsx: true,\n decorators: true,\n dynamicImport: true,\n },\n transform: {\n legacyDecorator: true,\n decoratorMetadata: true,\n },\n target: 'es2017',\n loose: true,\n externalHelpers: false,\n keepClassNames: true,\n },\n module: {\n type: 'commonjs',\n strict: false,\n strictMode: true,\n lazy: false,\n noInterop: false,\n },\n },\n },\n ],\n },\n optimization: {\n minimize: false,\n nodeEnv: false,\n },\n plugins: [\n new rspack.EnvironmentPlugin({\n NODE_ENV: 'development',\n }),\n new RunScriptWebpackPlugin({\n name: 'main.js',\n autoRestart: false,\n }),\n new rspack.HotModuleReplacementPlugin(),\n new rspack.CopyRspackPlugin({\n patterns: [{ from: 'public', to: 'public' }, { from: 'templates', to: 'templates' }, { from: 'i18n', to: 'i18n' }, { from: 'config', to: 'config' }],\n }),\n new TsCheckerRspackPlugin({\n typescript: {\n configFile: resolve('tsconfig.json'),\n },\n }),\n ],\n devServer: {\n hot: true,\n devMiddleware: {\n writeToDisk: true,\n },\n },\n cache: true,\n experiments: {\n cache: {\n type: 'persistent',\n },\n },\n watch: true,\n watchOptions: {\n ignored: /node_modules/,\n poll: 100,\n },\n};\n\nmodule.exports = config;\n\n```","author":{"url":"https://github.com/ying-bin","@type":"Person","name":"ying-bin"},"datePublished":"2025-05-21T07:31:43.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/291/rstack-examples/issues/291"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:62ee5da9-e30e-3d2b-7685-1a67afafe671 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CA16:9E1F1:2B5D158:3CF4C9A:697106F0 |
| html-safe-nonce | 504f96c811c1567edd5754ae39fe4b08c9e90f3d079ffc152c44cd714d387bc6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTE2OjlFMUYxOjJCNUQxNTg6M0NGNEM5QTo2OTcxMDZGMCIsInZpc2l0b3JfaWQiOiIyODM3NDIyMTA2NjYyMjA5MjY0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0e93e87e69b5b0f672a1c9542fcf0a4316e1df10bbd8a26880abbf7097a4f24b |
| hovercard-subject-tag | issue:3079234761 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/rstackjs/rstack-examples/291/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b099dfc2b76d7ef6b6f8258f1fc7c8c011687742fd2c42bb869cff48ea7ded94/rstackjs/rstack-examples/issues/291 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b099dfc2b76d7ef6b6f8258f1fc7c8c011687742fd2c42bb869cff48ea7ded94/rstackjs/rstack-examples/issues/291 |
| og:image:alt | 按照nestjs项目示例配置热更新,无法生效 使用的是@nestjs/platform-fastify框架 rspack配置如下: const { join, resolve } = require('path'); const { rspack } = require('@rspack/core'); const nodeExternals = require('webpack-node-... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ying-bin |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6d0e7b0d5e294a53c55f49e80755e785182080c6e6a48c9ed353bedddaee69f4 |
| turbo-cache-control | no-preview |
| go-import | github.com/rstackjs/rstack-examples git https://github.com/rstackjs/rstack-examples.git |
| octolytics-dimension-user_id | 129049372 |
| octolytics-dimension-user_login | rstackjs |
| octolytics-dimension-repository_id | 721103420 |
| octolytics-dimension-repository_nwo | rstackjs/rstack-examples |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 721103420 |
| octolytics-dimension-repository_network_root_nwo | rstackjs/rstack-examples |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6d5a3a396bc74e65fd3ef897b0a99a6e489debaa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width