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: docs/spfx/web-parts/basics/add-an-external-library.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ By default, the web part bundler automatically includes any library that is a de
26
26
```
27
27
28
28
> [!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`
30
30
31
31
3. Create a file in the your web part's folder called `validator.d.ts` and add the following:
32
32
@@ -69,7 +69,7 @@ In this example, you will share the [marked](https://www.npmjs.com/package/marke
69
69
2. Download the typings:
70
70
71
71
```sh
72
-
npm install @types/marked --save
72
+
npm install @types/marked --save-dev
73
73
```
74
74
75
75
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
101
101
1. Install the typings for jQuery:
102
102
103
103
```sh
104
-
npm install --save @types/jquery
104
+
npm install --save-dev @types/jquery
105
105
```
106
106
107
107
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
279
279
1. Install typings for Microsoft Ajax, which is a dependency for JSOM typings:
0 commit comments