Skip to content

Commit 65067e6

Browse files
baywetVesaJuvonen
authored andcommitted
updated install commands to save-dev on @types/* installations (#3480)
1 parent f96c2b4 commit 65067e6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/spfx/web-parts/basics/add-an-external-library.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ By default, the web part bundler automatically includes any library that is a de
2626
```
2727

2828
> [!NOTE]
29-
> Because you're using TypeScript, you need typings for the package you add. This is essential when you are writing code because TypeScript is just a superset of JavaScript. All the TypeScript code is still converted to JavaScript code when you compile. You can search for and find typings by using **npm**, for example: `npm install @types/{package} --save`
29+
> Because you're using TypeScript, you need typings for the package you add. This is essential when you are writing code because TypeScript is just a superset of JavaScript. All the TypeScript code is still converted to JavaScript code when you compile. You can search for and find typings by using **npm**, for example: `npm install @types/{package} --save-dev`
3030
3131
3. Create a file in the your web part's folder called `validator.d.ts` and add the following:
3232

@@ -69,7 +69,7 @@ In this example, you will share the [marked](https://www.npmjs.com/package/marke
6969
2. Download the typings:
7070
7171
```sh
72-
npm install @types/marked --save
72+
npm install @types/marked --save-dev
7373
```
7474
7575
3. Edit the **config/config.json**, and add an entry to the **externals** map. This is what tells the bundler to put this in a separate file. This prevents the bundler from bundling this library:
@@ -101,7 +101,7 @@ In this example, you will load jQuery from CDN. You don't need to install the np
101101
1. Install the typings for jQuery:
102102

103103
```sh
104-
npm install --save @types/jquery
104+
npm install --save-dev @types/jquery
105105
```
106106

107107
2. Update the `config.json` in the `config` folder to load jQuery from CDN. Add an entry to the `externals` field:
@@ -279,13 +279,13 @@ Loading SharePoint JSOM is essentially the same scenario as loading non-AMD scri
279279
1. Install typings for Microsoft Ajax, which is a dependency for JSOM typings:
280280
281281
```sh
282-
npm install @types/microsoft-ajax --save
282+
npm install @types/microsoft-ajax --save-dev
283283
```
284284
285285
2. Install typings for the JSOM:
286286
287287
```sh
288-
npm install @types/sharepoint --save
288+
npm install @types/sharepoint --save-dev
289289
```
290290
291291
3. Add entries to the `config.json`:

0 commit comments

Comments
 (0)