docs(nxdev): fix core-tutorial (#12216)
This commit is contained in:
parent
518caaddae
commit
38c86657b7
@ -64,7 +64,7 @@ To install Eleventy run:
|
||||
{% tab label="yarn" %}
|
||||
|
||||
```bash
|
||||
yarn add -D @11ty/eleventy@1.0.0
|
||||
yarn add -D -W @11ty/eleventy@1.0.0
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
@ -105,6 +105,10 @@ Next, add `packages/blog/src/index.html`:
|
||||
<p>Hello, Eleventy</p>
|
||||
```
|
||||
|
||||
## Clean Up
|
||||
|
||||
If you have a `workspace.json` file in the root, delete it.
|
||||
|
||||
## Running Eleventy with Nx
|
||||
|
||||
Now that we have the bare minimum set up for Eleventy, you can run:
|
||||
|
||||
@ -4,22 +4,16 @@ You probably noticed that you're using the same friendly cow ASCII art in the bl
|
||||
|
||||
## Create an Asset Library
|
||||
|
||||
You can make a library project just for holding the ASCII asset files. Let Nx know about the project by creating a `project.json` file like this:
|
||||
You can make a library project just for holding the ASCII asset files. Let Nx know about the project by creating a `package.json` file like this:
|
||||
|
||||
`packages/ascii/project.json`:
|
||||
`packages/ascii/package.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"root": "packages/ascii",
|
||||
"sourceRoot": "packages/ascii/assets",
|
||||
"projectType": "library"
|
||||
"name": "ascii"
|
||||
}
|
||||
```
|
||||
|
||||
{% callout type="note" title="Prefer a `package.json` file?" %}
|
||||
You could choose to make a `package.json` file here instead, if you prefer.
|
||||
{% /callout %}
|
||||
|
||||
Then move `cow.txt` out of the `cli` project to:
|
||||
|
||||
`packages/ascii/assets/cow.txt`:
|
||||
|
||||
@ -4,19 +4,32 @@ Manually telling Nx about the dependencies between your projects is helpful, but
|
||||
|
||||
Luckily, Nx core can automatically detect dependencies that are created in `.ts` or `.js` files.
|
||||
|
||||
**Side note 1:** If you want to disable detecting dependencies from source code and want to only use the dependencies as defined in `package.json` (the same way yarn does), you can add the following configuration to your `nx.json` file:
|
||||
## Analyze Source Files
|
||||
|
||||
Because we chose `npm` for the preset when we created the nx workspace, the `nx.json` is set to extend the npm preset settings.
|
||||
|
||||
```jsonc
|
||||
// nx.json
|
||||
{
|
||||
"extends": "nx/presets/npm.json"
|
||||
}
|
||||
```
|
||||
|
||||
This preset is set to only load dependencies from `package.json` or `project.json` files. To enable automatically detecting dependencies from source code, you can add the following configuration to your `nx.json` file:
|
||||
|
||||
```json
|
||||
{
|
||||
"pluginsConfig": {
|
||||
"@nrwl/js": {
|
||||
"analyzeSourceFiles": false
|
||||
"analyzeSourceFiles": true
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Side note 2:** If you want Nx to automatically detect dependencies for other languages, you can install a plugin for that language. There is a list of Nrwl maintained and third party plugins on the [community page](/community#plugin-directory).
|
||||
Other presets default this property to true.
|
||||
|
||||
**Side note:** If you want Nx to automatically detect dependencies for other languages, you can install a plugin for that language. There is a list of Nrwl maintained and third party plugins on the [community page](/community#plugin-directory).
|
||||
|
||||
## Create Messages Library
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user