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 22, 2025 5:03pm

@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 58b8dab

@davidantoon davidantoon changed the title feat(webpack): add typeCheckOptions and runtimeDependencies options feat(webpack,rspack): add typeCheckOptions, runtimeDependencies, and cache options Dec 18, 2025
@Coly010 Coly010 changed the title feat(webpack,rspack): add typeCheckOptions, runtimeDependencies, and cache options feat(rspack): add typeCheckOptions, runtimeDependencies, and cache options Dec 19, 2025
@Coly010
Copy link
Contributor

Coly010 commented Dec 19, 2025

@davidantoon Can you update the deprecation method to mention: 1. what to use instead, 2. that the deprecated property will be removed in Nx 24

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Dec 19, 2025

View your CI Pipeline Execution ↗ for commit 58b8dab

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ⛔ Cancelled 1h 40m 5s View ↗
nx run-many -t check-imports check-lock-files c... ⛔ Cancelled 2m 36s View ↗
nx-cloud record -- nx-cloud conformance:check ⛔ Cancelled 12s View ↗
nx-cloud record -- nx format:check ⛔ Cancelled 3s View ↗
nx-cloud record -- nx sync:check ⛔ Cancelled <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-12-23 12:59:30 UTC

@Coly010 Coly010 self-assigned this Dec 19, 2025
@davidantoon
Copy link
Contributor Author

@Coly010

I've updated all deprecation messages for skipTypeChecking (and related typeCheck option) across the following files:

Documentation

  • astro-docs/src/content/docs/technologies/build-tools/webpack/Guides/webpack-plugins.mdoc
    • Updated deprecation for skipTypeChecking under NxAppWebpackPlugin (line 249)
    • Updated deprecation for skipTypeChecking under withNx plugin (line 423)

Webpack package

  • packages/webpack/src/executors/webpack/schema.json (line 91)
    • Updated x-deprecated message
  • packages/webpack/src/plugins/nx-webpack-plugin/nx-app-webpack-plugin-options.ts (line 189)

Rspack package

  • packages/rspack/src/executors/rspack/schema.json (line 33)
    • Updated x-deprecated message
  • packages/rspack/src/plugins/utils/models.ts (lines 184, 189)
    • Updated @deprecated JSDoc comments for both skipTypeChecking and typeCheck properties

All deprecation messages now include:

  • What to use instead: typeCheckOptions
  • When the deprecated property will be removed: Nx 24

@frontegg-david
Copy link

@Coly010

Copy link
Contributor

@Coly010 Coly010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor changes to parsing the package.json for the deps, in the chance that they are not being resolved from the root node_modules folder. (nested node_modules etc)

based on pr code review comment, updated the rspack and webpack plugins json read to use
readJsonFile from nx/devkit instead of standard fs, also using resolve instead of static readfile to
support node_modules in project folder
@davidantoon
Copy link
Contributor Author

Some minor changes to parsing the package.json for the deps, in the chance that they are not being resolved from the root node_modules folder. (nested node_modules etc)

@Coly010 DONE

@davidantoon
Copy link
Contributor Author

@leosvelperez can you please review and approve this PR

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.

3 participants