-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(core): Add svelte docs recipe #18590
docs(core): Add svelte docs recipe #18590
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
f42d5e0
to
4e0a793
Compare
4e0a793
to
1953571
Compare
docs/map.json
Outdated
{ | ||
"name": "Add a Svelte Project", | ||
"id": "add-svelte", | ||
"description": "Add a Vue project to your repo", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"description": "Add a Vue project to your repo", | |
"description": "Add a Svelte project to your repo", |
}); | ||
``` | ||
|
||
{%callout type="Note"%} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{%callout type="Note"%} | |
{%callout type="Note" title="Why use the .mts file extension?" %} |
"build": { | ||
"executor": "@nx/vite:build", | ||
"outputs": ["{options.outputPath}"], | ||
"defaultConfiguration": "production", | ||
"options": { | ||
"outputPath": "dist/acme" | ||
}, | ||
"configurations": { | ||
"development": { | ||
"mode": "development" | ||
}, | ||
"production": { | ||
"mode": "production" | ||
} | ||
} | ||
}, | ||
"serve": { | ||
"executor": "@nx/vite:dev-server", | ||
"defaultConfiguration": "development", | ||
"options": { | ||
"buildTarget": "acme:build" | ||
}, | ||
"configurations": { | ||
"development": { | ||
"buildTarget": "acme:build:development", | ||
"hmr": true | ||
}, | ||
"production": { | ||
"buildTarget": "acme:build:production", | ||
"hmr": false | ||
} | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"build": { | |
"executor": "@nx/vite:build", | |
"outputs": ["{options.outputPath}"], | |
"defaultConfiguration": "production", | |
"options": { | |
"outputPath": "dist/acme" | |
}, | |
"configurations": { | |
"development": { | |
"mode": "development" | |
}, | |
"production": { | |
"mode": "production" | |
} | |
} | |
}, | |
"serve": { | |
"executor": "@nx/vite:dev-server", | |
"defaultConfiguration": "development", | |
"options": { | |
"buildTarget": "acme:build" | |
}, | |
"configurations": { | |
"development": { | |
"buildTarget": "acme:build:development", | |
"hmr": true | |
}, | |
"production": { | |
"buildTarget": "acme:build:production", | |
"hmr": false | |
} | |
} | |
}, | |
{ | |
"targets": { | |
"build": { | |
"executor": "@nx/vite:build", | |
"outputs": ["{options.outputPath}"], | |
"defaultConfiguration": "production", | |
"options": { | |
"outputPath": "dist/acme" | |
}, | |
"configurations": { | |
"development": { | |
"mode": "development" | |
}, | |
"production": { | |
"mode": "production" | |
} | |
} | |
}, | |
"serve": { | |
"executor": "@nx/vite:dev-server", | |
"defaultConfiguration": "development", | |
"options": { | |
"buildTarget": "acme:build" | |
}, | |
"configurations": { | |
"development": { | |
"buildTarget": "acme:build:development", | |
"hmr": true | |
}, | |
"production": { | |
"buildTarget": "acme:build:production", | |
"hmr": false | |
} | |
} | |
} | |
} | |
} |
|
||
Navigate to `project.json` and update it with the following content: | ||
|
||
```json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```json | |
```json {% fileName="/apps/svelteapp/project.json" %} |
**Create a new Nx workspace** | ||
|
||
```shell | ||
create-nx-workspace@latest acme --preset=ts-standalone --nx-cloud=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't start with standalone. Start with integrated. The idea is that someone already has an Nx workspace and wants to add Svelte to it.
## Create the application | ||
|
||
```shell | ||
touch index.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
touch index.html | |
touch apps/svelteapp/index.html |
export { default as Counter } from './Counter.svelte'; | ||
``` | ||
|
||
{% callout "Note" %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{% callout "Note" %} | |
{% callout "Note" title="Remember the default keyword" %} |
1953571
to
74c4dcd
Compare
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Add Svelte documentation for Nx recipes
Preview