124 Commits

Author SHA1 Message Date
Jack Hsu
40cf21b10c
feat(react): support port option for react app generator (#31552)
This PR adds the ability to set the port of the React application when
using the generator.

e.g.

```shell
npx nx g @nx/react:app --port 8080
```

This is useful when generating multiple apps and then running them in
parallel.
2025-06-13 08:53:14 -04:00
Colum Ferry
f9c427a80b
fix(webpack): handle package.json exports field for non-buildable libs (#31444)
Current Behavior
The webpack and rspack plugins for handling non-buildable libraries
don't properly process the exports field in package.json. They
incorrectly assume libraries have only a single entry point, typically
through a barrel file (index.ts).

When a library defines multiple export paths using the exports field
(e.g., "./*": "./src/*.ts"), the plugins fail to generate the correct
allowlist patterns for webpack externals. This causes build failures
when trying to use non-buildable libraries that expose multiple entry
points without barrel files.

Expected Behavior
The webpack and rspack plugins should properly parse the exports field
from package.json and generate appropriate allowlist patterns for all
exported subpaths. This includes:

Handling wildcard patterns ("./*": "./src/*.ts")
Processing conditional exports (import/require/development)
Supporting exact subpath exports ("./utils": "./src/utils.ts")
Escaping special characters in package names for regex patterns
Gracefully falling back to reading package.json directly when metadata
is unavailable

Co-authored-by: Claude <noreply@anthropic.com>
2025-06-09 13:58:57 +01:00
dpnolte
438457ab12
fix(rspack): must run type check with @nx/rspack:rspack when skipTypeChecking is false (#31027)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
- Create a project that uses @nx/rspack:rspack as build target with
SkipTypeChecking set to false.
- Run build target for project.
- Type check has not been run and will not bail in case of any
typescript errors

<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
- It should run type checking as documented:
https://nx.dev/nx-api/rspack/executors/rspack#skiptypechecking
I looked at the webpack executor and there it also runs the type check
based on `skipTypeChecking` and not the `typeCheck` alias. So I've
adjusted it accordingly for the rspack executor.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #31026

---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
2025-06-09 11:08:01 +01:00
Nadav Shatz
1afe6acabe
fix(rspack): Add missing return for rspack composoable plugin (#31372)
This was broken in https://github.com/nrwl/nx/pull/29691

it's missing this return.
2025-06-05 15:04:39 -06:00
Nicholas Cunningham
ae89efb8d1
fix(nextjs): add extension alias support for handling ESM libs (#31323)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently, if you try to import a ESM lib after you generate a Next.js
application it fails to build due to how the module exports `export *
from './lib/lib8446520.js';`.

This has been addressed with webpack and needs to be extended to
Next.js.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

You should work out of the box and you should be able to import a lib
defined like: `export * from './lib/lib8446520.js';.`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
This is also related to our webpack and rspack packages. Changes have
also been made to them to ensure consistency across bundlers.

Fixes #30714
2025-06-05 13:54:29 -06:00
Benjamin Cabanes
733122bc9d
docs(nx-dev): update hero section (#31460)
Update tagline.
2025-06-04 15:48:19 -04:00
Colum Ferry
34cf5a243f
fix(rspack): ensure nest applications generated correctly #31204 (#31424)
- fix(rspack): choosing nest as framework should not result in error
#31204
- fix(rspack): add deprecation message for application generator
- fix(rspack): ensure application generated projects are added to
excludes

## Current Behavior
Running the `@nx/rspack:application` generator with `--framework=nest`
results in an error due to mix of inferred and executor usage throughout
the generation process.

## Expected Behavior
Running the generator should pass without failure and create a working
project.
Deprecate the generator in favour of using project specific packages
(@nx/react etc)

## Related Issue(s)

Fixes #31204

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Coly010 <Coly010@users.noreply.github.com>
2025-06-03 13:41:17 +00:00
Johann Wagner
efc9c8d12a
fix(rspack): fix issue with optimization options in rspack config (#31337)
## Current Behavior
rspack.config.ts options related to optimizations are removed if the
mode is not "production". This makes the compile fail for all
non-production builds.

## Expected Behavior
If mode isn't set to "production" configuration related to optimization
should be passed through.

## Related Issue(s)
Fixes #31268 #30292
2025-05-30 11:41:13 -06:00
Nicholas Cunningham
f1171191dd
fix(webpack): add support for retrieving all transitive non-buildable dependencies (#31343)
This PR improves dependency resolution for Node.js apps using Webpack or
Rspack.

While we already handle direct dependencies for non-buildable libraries,
this update ensures that **transitive dependencies** are also properly
included. This guarantees that all necessary dependencies are bundled
when the main app/library is built.

closes: https://github.com/nrwl/nx/issues/31334
2025-05-27 00:53:45 -06:00
Leosvel Pérez Espinosa
752d418f78
feat(angular): support angular cli v20.0.0-rc.3 (#30715)
Add support for the Angular CLI **20.0.0-rc.3** version.
2025-05-26 10:00:47 -04:00
Benjamin Cabanes
1e30f3d148
chore(nx-dev): update tagline across projects (#31318)
Aligned all instances of the tagline. Changes include documentation, metadata, UI content, test assertions, and other project assets.
2025-05-23 16:20:35 -04:00
Colum Ferry
1ab77c8a55
fix(module-federation): use runtimeChunk false when not in dev mode (#31256)
## Current Behavior
In #30637 `runtimeChunk: false` was removed to allow HMR for styles.

## Expected Behavior
We need to set runtimeChunk to false or multiple when working with MF.
https://github.com/nrwl/nx/issues/31114#issuecomment-2881996043

## Related Issue(s)

Fixes #31114
2025-05-21 14:34:40 +01:00
Colum Ferry
9aee5b7adf
feat(angular): handle prerender and appshell in covert to rspack (#31210)
## Current Behavior
The `convert-to-rspack` generator does not handle projects that use
Prerendering or App Shell

## Expected Behavior
The generator sets up Prerendering and App Shell

Fixes https://github.com/nrwl/angular-rspack/issues/88
2025-05-14 15:26:41 +01:00
Colum Ferry
678965da21
feat(rspack): upgrade to version 1.3.8 (#31070)
## Current Behavior
We currently install Rspack at `^1.2`. The latest version of Rspack is
`1.3.8`
Angular Rspack now requires at least `1.3.5`

## Expected Behavior
Rspack installations should use latest version of `1.3.8`
2025-05-06 09:30:01 -04:00
Colum Ferry
5f488947dc
feat(remix)!: remove deprecated static-serve target name from inferred targets (#30982)
This commit also contains various changes to ensure serve-static tasks
depend on their build.

BREAKING CHANGE: Remove deprecated static-serve target name from Remix
Inferred Tasks in favour of serve-static.
2025-05-01 18:52:57 -04:00
Jason Jean
73da211694
feat(misc): remove migrations prior to v19 in preparation for v21 (#30839)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Users migrating from Nx 17 can go up to Nx 20. 

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Users migrating from Nx 19 can go up to Nx 21. Users migrating from Nx
17 or 18 should go to Nx 19 first.. then go to Nx 21.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-25 15:06:02 -04:00
Jason Jean
8214ab49f2
chore(repo): assign proper outputs to build targets (#30865)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

`nx:build` cannot be run in parallel with any other tasks. It was an
improper fix for an issue we were facing in our task graph. This is also
not workable if any continuous tasks are running.. which I want
`local-registry` to be running while things are built.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The proper outputs are set on `build` targets. Most of them only need
`README.md` as the output. `nx`, `create-nx-workspace`, and
`create-nx-plugin` are different and need a few more files.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-25 13:23:44 -04:00
Colum Ferry
a65f0f421b
feat(rspack): use custom WriteIndexHtmlPlugin to handle variable interpolation (#30805)
## Current Behavior
The `HtmlRspackPlugin` does not support interpolation of %VAR% in the
index.html.
This is supported with a custom Webpack Plugin for `@nx/webpack` for
generating index.html files.

## Expected Behavior
The `@nx/rspack` plugin should support the same feature set as webpack
for seamless migration.
Add a new `WriteIndexHtmlPlugin` for Rspack to support this.
It should only be used when `useLegacyHtmlPlugin` is set to true
2025-04-25 09:58:21 +01:00
Jason Jean
4254c4bcce
feat(core): allow executors to specify if they are continuous (#30821)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

The only way to set if a task is continuous is either directly in
`project.json` or via Project Graph Plugins.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Executors know if they are definitely continuous or not. Plenty of
existing continuous tasks are using executors. Executors are now able to
define if they are continuous in their `schema.json` files. Thus,
existing tasks configured with certain executors will automatically
become continuous.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-24 16:41:17 -04:00
Nicholas Cunningham
939cc732de
fix(module-federation): remove disabling runtimeChunk (#30637)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
When using Module Federation with an app that defines styles as a
separate entry point, HMR fails to update in the browser. Instead of
updating automatically, a warning is shown in the console related to a
missing chunk. A full-page reload is typically required, which is not
the intended behaviour.


## Expected Behavior
<!-- This is the behaviour we should expect with the changes in this PR
-->
HMR should work with styles as an entrypoint.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
The default is for `runtimeChunk` is `config.optimization.runtimeChunk =
{name: 'runtime'}` it is _not_ the same as `single` but the naming will
be the same.

Fixes #9582
2025-04-24 12:08:35 -06:00
Nicholas Cunningham
3f2a40ffec
chore(rspack): update convert inferred generator description (#30799)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently, the `convert-to-inferred` generator description inside the
rspack package references Webpack when it should reference Rspack
instead.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The `convert-to-inferred` generator description should reference Rspack
instead of Webpack.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes
2025-04-22 08:12:24 -06:00
Colum Ferry
6b081363c1
feat(webpack): set default sassImplementation to sass-embedded (#30580)
## Current Behavior
The `sassImplementation` option for Webpack and Rspack is set to `sass`
by default.
`sass-embedded` offers a faster alternative.

## Expected Behavior
Switch the default `sassImplementation` option to `sass-embedded`.
2025-04-16 11:06:57 +01:00
Jason Jean
dee4906f5e chore(repo): fix unit tests (#30431)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Unit tests are broken after rebase

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Unit tests are passing

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-15 09:23:45 -04:00
Colum Ferry
9fc7ffdaf3 feat(rspack): add continous inference support (#29973)
## Current Behavior
Rspack and Rsbuild Inference Plugins do not infer `continuous` for serve
tasks.

## Expected Behavior
Correctly infer `continuous` true.
2025-04-15 09:23:45 -04:00
Leosvel Pérez Espinosa
70f1e660c8
fix(rspack): do not reuse existing ts-node compiler options when inferring tasks (#30703)
## Current Behavior

The `@nx/rspack` graph plugin reuses the potentially existing
`TS_NODE_COMPILER_OPTIONS` to set the `env` property of the inferred
tasks for a TS config file. This is not correct since the env var could
have a different value (or not exist at all) when running tasks compared
to when the graph plugin runs.

## Expected Behavior

The `@nx/rspack` graph plugin should not reuse any existing
`TS_NODE_COMPILER_OPTIONS` when inferring tasks for a TS config file.

## Related Issue(s)

Fixes #
2025-04-14 14:36:20 +02:00
Nicholas Cunningham
32b48a3a04
feat(rspack): add support for non-buildable libraries in external dependencies (#30606)
Parity with https://github.com/nrwl/nx/pull/30538
2025-04-04 07:41:22 -06:00
Nicholas Cunningham
074da70ada
fix(webpack): enable legacy decorators and metadata in base config for compatibility (#30605)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
This PR fixes a runtime error in our NestJS application:

```
TypeError: Cannot read properties of undefined (reading 'get')
```
The root cause was that services were not being injected correctly due
to missing metadata reflection, which NestJS relies on for its
dependency injection system to resolve services.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
We now fully support NestJS's DI system by adding:

```ts
transform: {
  legacyDecorator: true,
  decoratorMetadata: true,
}
```
This restores proper behavior, and services are injected as expected.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #29136
2025-04-04 07:25:16 -06:00
Colum Ferry
27b78cd7ae
fix(webpack): migrate to latest version to prevent security vulnerabilities #29755 (#30590)
## Current Behavior
The `@nx/webpack` depends on `webpack` at version `^5.80.0`. Despite the
`^` allowing it to resolve to a higher minor, there has been no
migration to force users onto a higher version.
There is a security vulnerability with version `5.88.0`.

## Expected Behavior
Ensure users are migrated to a version where the security vulnerability
has been fixed.

## Related Issue(s)

Fixes #29755
2025-04-02 12:32:24 -04:00
Colum Ferry
9669dfdb62
feat(react): add crystal mf support to host and remote (#30424)
## Current Behavior
The `@nx/react` `host` and `remote` generators currently use executors
to support Module Federation


## Expected Behavior
When `bundler=rspack` use Crystal Module Federation with no executors
for Module Federation

## Related Issues
#30391
2025-04-02 16:58:45 +01:00
Colum Ferry
2dbff35de9
fix(rspack): allow typechecking during serve #29267 (#30558)
## Current Behavior
The `NxRspackAppPlugin` and `NxWebpackAppPlugin` will not provide
typechecking if using TS Solution setup because it already has a
typecheck target.
However, this means that typechecking will not be run during serve.

## Expected Behavior
Allow typechecking to run during serve even with TS Solution setup

## Related Issue(s)

Fixes #29267
2025-04-02 09:26:35 +01:00
Jack Hsu
2d210b8d0e
fix(bundling): webpack and rspack builds respect output.clean config option (#30573)
This PR fixes and issue where the standard `output.clean` option is
ignored and replaced by the Nx-specific `deleteOutputPath` option on the
`NxAppWebpackPlugin` and `NxAppRspackPlugin` plugins.

We want to allow users to use standards over our own features, so if we
see that `output.clean` is set in webpack/rspack config, then we use
that value.

For example, an Rspack config could be:

```js
const { NxAppRspackPlugin } = require("@nx/rspack/app-plugin");
const { join } = require("path");

module.exports = {
  output: {
    path: join(__dirname, "dist/demo"),
    clean: false, // <-- THIS DOES NOT WORK!
  },
  plugins: [
    new NxAppRspackPlugin({
      // ...
    }),
  ],
};
```

But even though `output.clean` is `false`, each build will still delete
`dist`. The only way to disable that behavior is to use the Nx-specific
option like this:

```js
const { NxAppRspackPlugin } = require("@nx/rspack/app-plugin");
const { join } = require("path");

module.exports = {
  output: {
    path: join(__dirname, "dist/demo"),
  },
  plugins: [
    new NxAppRspackPlugin({
      deleteOutputPath: false,
      // ...
    }),
  ],
};
```


## Current Behavior

Setting `output.clean` in Webpack/Rspack config does nothing, and we
always default our own `deleteOutputPath` to `true`.

## Expected Behavior
Setting `output.clean` standard option is respected.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-01 21:16:05 -04:00
Colum Ferry
c8e4e0f9ef
fix(rspack): remove unused plugin-minify (#30521)
## Current Behavior
`@nx/rspack` set ups currently install `@rspack/plugin-minify` which has
been deprecated. It is also unused in the configurations that are
generated.

## Expected Behavior
Remove unused the unused `@rspack/plugin-minify`

## Related Issue(s)

Fixes #30318
2025-03-27 13:18:59 +00:00
Colum Ferry
e08f3479e6
fix(webpack): allow baseHref to not be set #30291 (#30519)
## Current Behavior
The `NxAppWebpackPlugin` and `NxAppRspackPlugin` both always set `<base
href="` even when it is set to undefined.

## Expected Behavior
If `baseHref` is set to false, do not set `<base href`.

## Related Issues
#30291
2025-03-27 13:18:16 +00:00
Leosvel Pérez Espinosa
5dbe040374
fix(misc): override customConditions when using an incompatible module resolution (#30477)
## Current Behavior

In a few different places (Crystal plugins, executors, generators,
helpers) where `ts-node` compiler options are overridden and
`moduleResolution` is being set to something other than `node16`,
`nodenext`, or `bundler`, an error can occur if the `customConditions`
compiler option is being used.

## Expected Behavior

When overriding the `ts-node` compiler options and changing forcing
`moduleResolution` to have a value that's incompatible with
`customConditions`, the latter should be unset (set to `null`) to avoid
errors.

## Related Issue(s)

Fixes #
2025-03-25 07:51:02 -04:00
Colum Ferry
487aa6fa78
feat(module-federation): add ssr support to rspack crystal plugin (#30437)
## Current Behavior
The current `NxModuleFederationPlugin` does not support SSR


## Expected Behavior
The current `NxModuleFederationPlugin` supports SSR
2025-03-21 15:17:45 +00:00
Colum Ferry
beb178430e
feat(rspack): alias convert-webpack to convert-to-rspack (#30367)
## Current Behavior
`convert-webpack` generator is offered by `@nx/rspack` plugin.

## Expected Behavior
Add an alias of `convert-to-rspack` to make it clearer
2025-03-13 17:50:06 -04:00
Leosvel Pérez Espinosa
7f1e1cfa78
feat(rspack): infer ts-node compiler options in rspack task env when using a typescript config file (#30345)
Infer the relevant ts-node compiler options to support an Rspack config
file using TypeScript as per https://rspack.dev/config/#using-ts-node.

## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #
2025-03-12 14:30:11 +00:00
Leosvel Pérez Espinosa
ada8be473d
fix(misc): fix misc issues in project generators for the ts solution setup (#30111)
The following are the main changes in the context of the TS solution
setup:

- Ensure `name` in `package.json` files is set to the import path for
all projects
- Set `nx.name` in `package.json` files when the user provides a name
different than the package name (import path)
- Clean up project generators so they don't set the `nx` property in
`package.json` files unless strictly needed
- Fix `@nx/vue:application` generator so it creates the Nx config in a
`package.json` file for e2e projects
- Ensure `@types/node` is installed in `vitest` generator
- Fix generated Vite config typing error (surfaced with Vite 6)
- Ensure `jsonc-eslint-parser` is installed when the
`@nx/dependency-checks` rule is added to the ESLint config
- Misc minor alignment changes

## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #
2025-03-05 20:08:10 -05:00
Colum Ferry
648129fc48
fix(bundling): remove migration always adding sass-embedded (#30276)
## Current Behavior
There is a migration that always adds `sass-embedded` for Rspack and
Webpack for 20.5

## Expected Behavior
`sass-embedded` is already a dependency of Rspack and Webpack and
therefore does not need to be added to users package.json - especially
as they may not be using it.
2025-03-05 14:12:33 -05:00
Craigory Coppola
5382c8af65
fix(core): ensure daemon enabled check is unchanged (#30228) 2025-02-28 17:13:19 +00:00
Isaac Mann
8b11d8bfe5
docs(core): add migrations docs for 20.x (#30186)
Adds migration docs for all 20.0 through 20.4 migrations
2025-02-27 15:58:41 -05:00
Kevin Hallmark
c02719d2df
feat(module-federation): Update to the latest version of @module-federation (#30147) 2025-02-25 15:49:19 +04:00
Colum Ferry
82169ace03
feat(webpack): use sass-embedded and modern-compiler for sass (#29999)
## Current Behavior
Webpack and Rspack currently use `sass` and its Legacy API with
`sass-loader`.
There is also no method to pass stylePreprocessorOptions other than
`includePaths` to the loaders.


## Expected Behavior
Switch to using `modern-compiler` api to remove deprecation warnings and
improve build performance.
Allow users to choose between `sass` and `sass-embedded` for sass
compiler implementation.

Expand the `stylePreprocesserOptions` interface to accept
`includePaths`, `sassOptions` and `lessOptions` that will be passed to
the appropriate loader.
2025-02-24 12:44:19 -05:00
Colum Ferry
251959c6b0
feat(rspack): use ts-checker-rspack-plugin instead of fork-ts-checker-webpack-plugin (#30121)
## Current Behavior
Our Rspack support currently leverages `fork-ts-checker-webpack-plugin`
to handle typechecking during build.

## Expected Behavior
Switch to using `ts-checker-rspack-plugin` for better memory management
and typecheck support.
2025-02-20 15:54:18 -05:00
Leosvel Pérez Espinosa
c78279990d
fix(rspack): handle potentially missing lockfile in @nx/rspack/plugin plugin (#30086)
## Current Behavior

If the lock file is missing the `@nx/rspack/plugin` plugin throws a
cryptic error.

## Expected Behavior

The `@nx/rspack/plugin` should handle a missing lock file.

## Related Issue(s)

Fixes #
2025-02-18 12:30:43 +01:00
Colum Ferry
309a2a9228
fix(rspack): pin rspack 1.2.2 (#29997)
## Current Behavior
Rspack v1.2.3 was released with some issues around resolving and
transforming modules throwing errors at build time.

## Expected Behavior
Pin Rpsack to 1.2.2 until a solution for the above problem can be
resolved.
2025-02-14 08:04:11 -05:00
Craigory Coppola
c2e89f87b5
feat(core): add multi hash fn (#29935)
Adds function to compute multiple glob hashes in native code at the same time, greatly speeding up certain plugin performance.
2025-02-13 14:21:54 -05:00
Nicholas Cunningham
4e04979a36
fix(rspack): should be inferred by default (#29736)
This PR updates the Rspack Plugin to be inferred by default.

### Currently
When you generate a project using rspack it would not be inferred and
would add the executor to `project.json`.

### After
Generating a project using rspack will add it to inferred plugins inside
`nx.json` and update the `rspack.config.js` to be a standard config and
use Nx plugins.
2025-02-12 07:24:39 -07:00
Colum Ferry
18c555a50e
feat(rspack): improve plugin createNodes performance (#29876)
## Current Behavior
Currently, calculating nodes via the `@nx/rspack/plugin` takes a long
time because the hash generation attempts to hash every source file.
This is problematic because the targets that are inferred do not rely on
the source files themselves and rather just the config file.

It also means the time taken to infer the targets grows as the project
grows.

## Expected Behavior
Calculate the hash based off the config file and the installed
dependencies, allowing it to scale as the project grows and allowing it
to be invalidated if dependencies change.

## Tested Results
Application with 90k files
Previous:  2mins
New: 1.18s
2025-02-04 21:30:34 +00:00
Leosvel Pérez Espinosa
8d056c9cdb
fix(misc): generate config with output contained within project root (#29850)
Updates some generators to ensure the build tool produces the output
contained within the project root for the TS solution setup.

## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #
2025-02-04 09:16:02 -05:00