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
- [project] is the name of the project to which you want to add the builder
56
58
- [architect-target] is the name of build target you want to run (build, serve, test etc. or any custom target)
57
-
- [application|dev-server] one of the supported builders - [application](#Custom-webpack-browser) or [dev-server](#Custom-webpack-extract-i18n)
59
+
- [application|dev-server|unit-test] one of the supported builders - [application](#Custom-esbuild-application), [dev-server](#Custom-esbuild-dev-server), or [unit-test](#Custom-esbuild-unit-test)
58
60
3. If `[architect-target]` is not one of the predefined targets (like build, serve, test etc.) then run it like this:
59
61
`ng run [project]:[architect-target]`
60
62
If it is one of the predefined targets, you can run it with `ng [architect-target]`
@@ -228,6 +231,35 @@ The `@angular-builders/custom-esbuild:dev-server` is an enhanced version of the
228
231
}
229
232
```
230
233
234
+
## Custom ESBuild `unit-test`
235
+
236
+
The `@angular-builders/custom-esbuild:unit-test` builder is an enhanced version of the `@angular/build:unit-test` builder that reuses your application ESBuild plugins during test execution. It reads the `plugins` from the referenced `:application` build target and runs the official unit test builder with those plugins applied.
237
+
There is no need to specify a `runner` option as the only supported test runner is Vitest.
Since Angular 8, `index.html` is not generated as part of the build. If you want to modify your `index.html`, you should use the `indexHtmlTransformer` option. `indexHtmlTransformer` is a path (relative to the workspace root) to a `.js` or `.ts` file that exports a transformation function for `index.html`. If `indexHtmlTransformer` is written in TypeScript, the application's `tsConfig` file will be used by `tsnode` for its execution:
0 commit comments