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
Copy file name to clipboardExpand all lines: content/codespaces/getting-started-with-codespaces/getting-started-with-your-nodejs-project-in-codespaces.md
+13-17Lines changed: 13 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,23 +30,19 @@ This guide shows you how to set up your JavaScript, Node.js, or TypeScript proje
30
30
31
31
When you create a codespace, your project is created on a remote VM that is dedicated to you. By default, the container for your codespace has many languages and runtimes including Node.js, JavaScript, Typescript, nvm, npm, and yarn. It also includes a common set of tools like git, wget, rsync, openssh, and nano.
32
32
33
-
You can customize your codespace by adjusting the amount of vCPUs and RAM], [adding dotfiles to personalize your environment](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account), or by modifying the tools and scripts installed.
33
+
You can customize your codespace by adjusting the amount of vCPUs and RAM, [adding dotfiles to personalize your environment](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account), or by modifying the tools and scripts installed.
34
34
35
35
{% data variables.product.prodname_codespaces %} uses a file called `devcontainer.json` to store configurations. On launch {% data variables.product.prodname_codespaces %} uses the file to install any tools, dependencies, or other set up that might be needed for the project. For more information, see "[Configuring Codespaces for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
36
36
37
-
The next section shows you how to modify your tools by adding a dev container.
38
-
39
37
### Step 2: Add a dev container to your codespace from a template
40
38
41
39
The default codespaces container will support running Node.js projects like [vscode-remote-try-node](https://github.com/microsoft/vscode-remote-try-node) out of the box. By setting up a custom container you can customize the tools and scripts that run as part of codespace creation and ensure a fully reproducible environment for all {% data variables.product.prodname_codespaces %} users in your repository.
42
40
43
-
To set up your project with a custom container, you will need to use a `devcontainer.json` file to define the environment. In {% data variables.product.prodname_codespaces %} you can add this either from a template or you can create your own. For more information on dev containers, see [Configuring your codespace](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project).
44
-
45
-
This example guides you through adding a `devcontainer.json` file from a template.
41
+
To set up your project with a custom container, you will need to use a `devcontainer.json` file to define the environment. In {% data variables.product.prodname_codespaces %} you can add this either from a template or you can create your own. For more information on dev containers, see "[Configuring Codespaces for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)".
46
42
47
43
1. Access the command palette (`shift command P` / `shift control P`), then start typing "dev container". Click **Codespaces: Add Development Container Configuration Files...**
48
44

49
-
3. For this example, click **Node.js**. In practice, you could select any container that’s specific to Node or a combination of tools such as Node and MongoDB.
45
+
3. For this example, click **Node.js**. If you need additional features you can select any container that’s specific to Node or a combination of tools such as Node and MongoDB.
50
46

51
47
4. Click the recommended version of Node.js.
52
48

@@ -96,18 +92,18 @@ The newly added `devcontainer.json` file defines a few properties that are descr
96
92
}
97
93
```
98
94
99
-
-**Name** - We can name our dev container anything, this is just the default
100
-
-**Build** - Our build properties
101
-
-**Dockerfile** - In our build object, Dockerfile is a reference to the Dockerfile in the same folder that was the second file added to our project. This is the reference path.
95
+
-**Name** - You can name your dev container anything, this is just the default.
96
+
-**Build** - The build properties.
97
+
-**dockerfile** - In the build object, dockerfile is a reference to the Dockerfile that was also added from the template.
102
98
-**Args**
103
-
-**Variant**: We only have one build argument here which is the node variant we want to use which is passed into our Dockerfile.
104
-
-**Settings** - These are {% data variables.product.prodname_vscode %} settings we wish to set
105
-
-**Terminal.integrated.shell.linux** - While bash is the default here, we could use zsh for example by modifying this.
99
+
-**Variant**: This file only contains one build argument, which is the node variant we want to use that is passed into the Dockerfile.
100
+
-**Settings** - These are {% data variables.product.prodname_vscode %} settings that you can set.
101
+
-**Terminal.integrated.shell.linux** - While bash is the default here, you could use other terminal shells by modifying this.
106
102
-**Extensions** - These are extensions included by default.
107
103
-**Dbaeumer.vscode-eslint** - ES lint is a great extension for linting, but for JavaScript there are a number of great Marketplace extensions you could also include.
108
-
-**forwardPorts** - By default we can forward a port, like port 3000, but these will also forward automatically
109
-
-**postCreateCommand** - If we want to run anything after we land in our codespace that’s not defined in our Dockerfile, like yarn install or npm install, we can do that here
110
-
-**remoteUser** - We’re running as the node user, but you can optionally set this to root
104
+
-**forwardPorts** - Any ports listed here will be forwarded automatically.
105
+
-**postCreateCommand** - If you want to run anything after you land in your codespace that’s not defined in the Dockerfile, you can do that here.
106
+
-**remoteUser** - By default, you’re running as the vscode user, but you can optionally set this to root.
111
107
112
108
##### Dockerfile
113
109
@@ -145,7 +141,7 @@ With your dev container added and a basic understanding of what everything does,
145
141
"forwardPorts": [4000],
146
142
```
147
143
148
-
For more information on `devcontainer.json` properties, see the [devcontainer.json reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference)on the Visual Studio Code docs.
144
+
For more information on `devcontainer.json` properties, see the [devcontainer.json reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference)in the {% data variables.product.prodname_vscode %} docs.
149
145
150
146
3. To rebuild your container, access the command palette (`shift command P` / `shift control P`), then start typing "rebuild". Click **Codespaces: Rebuild Container**.
0 commit comments