Skip to content

Conversation

@davidantoon
Copy link
Contributor

@davidantoon davidantoon commented Dec 18, 2025

Current Behavior

  • The skipTypeChecking option is a simple boolean that only allows enabling/disabling type checking
  • Rspack executor is missing the runtimeDependencies option that webpack has
  • The cache configuration is hardcoded and cannot be overridden by users

Expected Behavior

  • New typeCheckOptions option allows configuring type checking with { async: true } to run type checking in a separate process without blocking the build
  • The deprecated skipTypeChecking option is maintained for backward compatibility
  • Rspack now supports runtimeDependencies option for adding runtime dependencies to generated package.json (useful for Docker installs)
  • New cache option allows users to override webpack/rspack caching behavior while maintaining backward-compatible defaults

Related Issue(s)

N/A - Standalone feature

Changes Made

typeCheckOptions (webpack & rspack)

  • Added TypeCheckOptions interface with async property
  • Added typeCheckOptions option to plugin options interfaces
  • Updated apply-base-config.ts to normalize typeCheckOptions from deprecated skipTypeChecking for backward compatibility
  • Added schema definitions to schema.json and schema.d.ts

runtimeDependencies (webpack & rspack)

  • Added runtimeDependencies option to NxAppRspackPluginOptions
  • Updated GeneratePackageJsonPlugin to resolve and include runtime dependencies
  • Added schema definitions to schema.json and schema.d.ts

cache (webpack & rspack)

  • Added cache option to plugin options interfaces
  • Updated apply-base-config.ts to check 'cache' in options before applying defaults
  • Allows explicit cache: undefined to force cache to be disabled
  • Maintains backward-compatible defaults:
    • Webpack: { type: 'memory' } for Node targets in watch mode
    • Rspack: true for Node targets in watch mode, true in dependent config

Files Changed

Webpack:

  • packages/webpack/src/plugins/nx-webpack-plugin/nx-app-webpack-plugin-options.ts
  • packages/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.ts
  • packages/webpack/src/executors/webpack/schema.json
  • packages/webpack/src/executors/webpack/schema.d.ts
  • packages/webpack/src/plugins/generate-package-json-plugin.ts

Rspack:

  • packages/rspack/src/plugins/utils/models.ts
  • packages/rspack/src/plugins/utils/apply-base-config.ts
  • packages/rspack/src/plugins/utils/plugins/generate-package-json-plugin.ts
  • packages/rspack/src/executors/rspack/schema.json
  • packages/rspack/src/executors/rspack/schema.d.ts

Documentation:

  • astro-docs/.../webpack/Guides/webpack-plugins.mdoc
  • packages/webpack/docs/webpack-build-executor-examples.md

davidantoon and others added 8 commits September 14, 2025 15:07
Added documentation for the mergeExternals option in NxAppWebpackPlugin.
…config.ts

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
# Conflicts:
#	docs/shared/packages/webpack/webpack-plugins.md
#	packages/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.ts
#	packages/webpack/src/plugins/nx-webpack-plugin/nx-app-webpack-plugin-options.ts
@davidantoon davidantoon requested review from a team as code owners December 18, 2025 19:50
@vercel
Copy link

vercel bot commented Dec 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
nx-dev Ready Ready Preview Dec 19, 2025 0:46am

@netlify
Copy link

netlify bot commented Dec 18, 2025

👷 Deploy request for nx-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 7b258b0

@davidantoon davidantoon changed the title feat(webpack): add typeCheckOptions and runtimeDependencies options feat(webpack,rspack): add typeCheckOptions, runtimeDependencies, and cache options Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant