Skip to content

Commit ff8f5b6

Browse files
committed
Update create-vite intsructions in part1a
1 parent 304a2c1 commit ff8f5b6

File tree

3 files changed

+27
-12
lines changed

3 files changed

+27
-12
lines changed

src/content/1/en/part1a.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,26 @@ We will now start getting familiar with probably the most important topic of thi
1111

1212
The easiest way to get started by far is by using a tool called [Vite](https://vitejs.dev/).
1313

14-
Let's create an application called <i>introdemo</i>, navigate to its directory and install the libraries:
14+
Let's create a new application using the <i>create-vite</i> tool:
1515

1616
```bash
17-
# npm 6.x (outdated, but still used by some):
18-
npm create vite@latest introdemo --template react
19-
20-
# npm 7+, extra double-dash is needed:
21-
npm create vite@latest introdemo -- --template react
17+
npm create vite@latest
2218
```
2319

20+
Let's answer the questions presented by the tool as follows:
21+
22+
![create-vite tool selection view, where the project is named part1, the framework is React, the variant is JavaScript, and all other questions are answered with No](../../images/1/1-create-vite.png)
23+
24+
We have now created an application named <i>part1</i>. The tool could have also installed the required dependencies and started the application automatically if we had answered "Yes" to the question "Install with npm and start now?" However, we will perform these steps manually so we can see how they are done.
25+
26+
Next, let's move into the application's directory and install the required libraries:
27+
2428
```bash
25-
cd introdemo
29+
cd part1
2630
npm install
2731
```
2832

29-
The application is started as follows
33+
The application is started as follows:
3034

3135
```bash
3236
npm run dev
@@ -87,7 +91,7 @@ By default, the file <i>index.html</i> doesn't contain any HTML markup that is v
8791
<meta charset="UTF-8" />
8892
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
8993
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
90-
<title>introdemo</title>
94+
<title>part1</title>
9195
</head>
9296
<body>
9397
<div id="root"></div>

src/content/1/fi/osa1a.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,21 @@ Alamme nyt tutustua kurssin ehkä tärkeimpään teemaan, [React](https://react.
1111

1212
Helpoin tapa päästä alkuun on [Vite](https://vitejs.dev/)-nimisen työkalun käyttö.
1313

14-
Luodaan sovellus nimeltään <i>part1</i>, mennään sovelluksen sisältämään hakemistoon ja asennetaan sovelluksen käyttämät kirjastot:
14+
Luodaan uusi sovellus <i>create-vite</i>-työkalun avulla:
15+
16+
```bash
17+
npm create vite@latest
18+
```
19+
20+
Vastaillaan työkalun esittämiin kysymyksiin seuraavasti:
21+
22+
![create-vite-työkalun valintanäkymä, jossa valitaan projektin nimeksi part1, frameworkiksi React, variantiksi JavaScript ja muihin kysymyksiin vastataan kieltävästi](../../images/1/1-create-vite.png)
23+
24+
Loimme siis <i>part1</i>-nimisen sovelluksen. Työkalu olisi voinut myös asentaa tarvittavat riippuvuudet ja käynnistää sen jälkeen sovelluksen automaattisesti, jos olisimme vastanneet myöntävästi kysymykseen "Install with npm and start now?" Teemme vaiheet nyt kuitenkin manuaalisesti, jotta pääsemme näkemään, miten ne tehdään.
25+
26+
Siirrytään sovelluksen sisältämään hakemistoon ja asennetaan sovelluksen käyttämät kirjastot:
1527

1628
```bash
17-
npm create vite@latest part1 -- --template react
1829
cd part1
1930
npm install
2031
```
@@ -79,7 +90,7 @@ Tiedosto <i>index.html</i> on headerin määrittelyjä lukuun ottamatta oleellis
7990
<meta charset="UTF-8" />
8091
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
8192
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
82-
<title>Vite + React</title>
93+
<title>part1</title>
8394
</head>
8495
<body>
8596
<div id="root"></div>
41.7 KB
Loading

0 commit comments

Comments
 (0)