Create a Nuxt Application for Nx.
Your new Nuxt application will be generated with the following directory structure, following the suggested directory structure for Nuxt applications:
my-nuxt-app ├── nuxt.config.ts ├── project.json ├── src │ ├── app.vue │ ├── assets │ │ └── css │ │ └── styles.css │ ├── components │ │ └── NxWelcome.vue │ ├── pages │ │ ├── about.vue │ │ └── index.vue │ ├── public │ │ └── favicon.ico │ └── server │ ├── api │ │ └── greet.ts │ └── tsconfig.json ├── tsconfig.app.json ├── tsconfig.json ├── tsconfig.spec.json └── vitest.config.ts
Your new app will contain the following:
pages
NxWelcome
) under components
greet
API endpoint that returns a JSON response under /api/greet
vitest
app.vue
) will contain the navigation links to the home and about pages, and the nuxt-page
component to display the contents of your pages.❯
nx g @nx/nuxt:app apps/nested/myapp
Generate pages and componentsYou can use the the @nx/vue:component
generator to generate new pages and components for your application. You can read more on the @nx/vue:component
generator documentation page, but here are some examples:
❯
nx g @nx/nuxt:component my-app/src/pages/my-page
Usagenx generate application ...
By default, Nx will search for application
in the default collection provisioned in workspace.json.
You can specify the collection explicitly as follows:
nx g @nx/nuxt:application ...
Show what will be generated without writing to disk:
nx g application ... --dry-run
The directory of the new application.
string
Default: none
Accepted values: eslint
, none
The tool to use for running lint checks.
string
Pattern: (?:^@[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*\\/[a-zA-Z0-9-~][a-zA-Z0-9-._~]*|^[a-zA-Z][^:]*)$
The name of the application.
string
Default: none
Accepted values: vitest
, none
Test runner to use for unit tests.
string
Default: playwright
Accepted values: playwright
, cypress
, none
Test runner to use for end to end (E2E) tests.
Generate JavaScript files rather than TypeScript files.
The file extension to be used for style files.
Whether or not to configure the ESLint parserOptions.project
option. We do not do this by default for lint performance reasons.
Add tags to the application (used for linting).
Use a project.json
configuration file instead of inlining the Nx configuration in the package.json
file.
InternalHidden
Create an application at the root of the workspace.
Do not add dependencies to package.json
.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4