nx/packages/web/docs/application-examples.md
Leosvel Pérez Espinosa dc67660fec
fix(misc): update artifact generator option descriptions and cleanup leftovers (#29077)
- Update artifact generator schemas:
- Clarify `path` is the artifact file path relative to the current
working directory
  - Clarify `name` is the artifact symbol name
- Remove prompt for `name` and remove it from the important options
(won't be displayed by default in Nx Console generation UI, it will be
part of the collapsed options) given that most of the time, it's meant
to match the filename (last segment of the `path`)
- Remove some leftover options related to the name and path formats that
were previously missed
- Fix an issue with NestJS generators
- Fix an issue with Next `page` generator

<!-- 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 -->

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

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

Fixes #
2024-11-28 09:44:44 -05:00

791 B

Examples

{% tabs %} {% tab label="Simple Application" %}

Create an application named my-app:

nx g @nx/web:application apps/my-app

{% /tab %}

{% tab label="Application using Vite as bundler" %}

Create an application named my-app:

nx g @nx/web:app apps/my-app --bundler=vite

When choosing vite as the bundler, your unit tests will be set up with vitest, unless you choose none for unitTestRunner.

{% /tab %}

{% tab label="In a nested directory" %}

Create an application named my-app in the my-dir directory:

nx g @nx/web:app apps/my-dir/my-app

{% /tab %}

{% tab label="Add tags" %}

Add tags to the application (used for linting).

nx g @nx/web:app apps/my-app --tags=scope:admin,type:ui

{% /tab %} {% /tabs %}