feat(rspack): add typeCheckOptions, runtimeDependencies, and cache options#33931
feat(rspack): add typeCheckOptions, runtimeDependencies, and cache options#33931jaysoo merged 24 commits intonrwl:masterfrom
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@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 |
|
View your CI Pipeline Execution ↗ for commit ee9f911
☁️ Nx Cloud last updated this comment at |
|
I've updated all deprecation messages for skipTypeChecking (and related typeCheck option) across the following files: Documentation
Webpack package
Rspack package
All deprecation messages now include:
|
packages/rspack/src/plugins/utils/plugins/generate-package-json-plugin.ts
Outdated
Show resolved
Hide resolved
Coly010
left a comment
There was a problem hiding this comment.
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)
packages/rspack/src/plugins/utils/plugins/generate-package-json-plugin.ts
Show resolved
Hide resolved
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
@Coly010 DONE |
|
@leosvelperez can you please review and approve this PR |
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
skipTypeCheckingoption is a simple boolean that only allows enabling/disabling type checkingruntimeDependenciesoption that webpack hascacheconfiguration is hardcoded and cannot be overridden by usersExpected Behavior
typeCheckOptionsoption allows configuring type checking with{ async: true }to run type checking in a separate process without blocking the buildskipTypeCheckingoption is maintained for backward compatibilityruntimeDependenciesoption for adding runtime dependencies to generatedpackage.json(useful for Docker installs)cacheoption allows users to override webpack/rspack caching behavior while maintaining backward-compatible defaultsRelated Issue(s)
N/A - Standalone feature
Changes Made
typeCheckOptions (webpack & rspack)
TypeCheckOptionsinterface withasyncpropertytypeCheckOptionsoption to plugin options interfacesapply-base-config.tsto normalizetypeCheckOptionsfrom deprecatedskipTypeCheckingfor backward compatibilityschema.jsonandschema.d.tsruntimeDependencies (webpack & rspack)
runtimeDependenciesoption toNxAppRspackPluginOptionsGeneratePackageJsonPluginto resolve and include runtime dependenciesschema.jsonandschema.d.tscache (webpack & rspack)
cacheoption to plugin options interfacesapply-base-config.tsto check'cache' in optionsbefore applying defaultscache: undefinedto force cache to be disabled{ type: 'memory' }for Node targets in watch modetruefor Node targets in watch mode,truein dependent configFiles Changed
Webpack:
packages/webpack/src/plugins/nx-webpack-plugin/nx-app-webpack-plugin-options.tspackages/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.tspackages/webpack/src/executors/webpack/schema.jsonpackages/webpack/src/executors/webpack/schema.d.tspackages/webpack/src/plugins/generate-package-json-plugin.tsRspack:
packages/rspack/src/plugins/utils/models.tspackages/rspack/src/plugins/utils/apply-base-config.tspackages/rspack/src/plugins/utils/plugins/generate-package-json-plugin.tspackages/rspack/src/executors/rspack/schema.jsonpackages/rspack/src/executors/rspack/schema.d.tsDocumentation:
astro-docs/.../webpack/Guides/webpack-plugins.mdocpackages/webpack/docs/webpack-build-executor-examples.md