You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additionally, should you provide configurations through project.json and esbuild.config.ts we would have a priority merging
For example priority would be
I think 2-4 are essentially the same case because passing via CLI will override both the Nx and project configurations. And from the executor's POV, it's all treated the same way.
The main prioritization should be Nx > esbuild.config.js.
Here's an example use case:
User defines export default { bundle: false } in their esbuild.config.js
User runs nx build <app> --bundle=true
Nx will run with bundle: true since it is passed in from CLI. Otherwise, there is no way to override esbuild.config.js.
This is the same thing we do for Vite.
One more consideration is how we can make it type-safe. Vite and other tools export an identity function defineConfig that type-checks that the config is matching what's expected.
Description
Nx plugins primarily get target (build/lint/test) configurations from a json file
project.json
.Which works in the majority of scenarios.
However, the
esbuild
plugins API allows users to provide a setup function which is passed to the build API.https://esbuild.github.io/plugins/#finding-plugins
As at our current state Nx 15.7.0 we do not fully support this approach.
Motivation
Initially, this came out of an issue: #14823
PR: to remove plugin in favour of doing it as a feature: #14997
Suggested Implementation
The prospective implementation would be similar to what @jaysoo highlighted.
Additionally, should you provide configurations through
project.json
andesbuild.config.ts
we would have a priority mergingFor example priority would be
esbuild.config.ts
project.json
configurationAlternate Implementations
Also support
.js
filesThe text was updated successfully, but these errors were encountered: