Skip to content

Commit a76d028

Browse files
authored
Build instead of Serve for library component
In order to compile library component, we should do "gulp build" instead of "gulp serve", since library component does not have any visual appearance.
1 parent b3388eb commit a76d028

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/spfx/library-component-tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ localization_priority: Priority
5252
## How to consume a third-party SPFx library (for local testing)
5353

5454
1. Run `npm link` from the root directory of library solution. In this case, it would be from the **corporate-library** folder.
55-
1. Right after creating the symbolic link to your new SPFx library component, don't forget to run at least once `gulp serve`. Compile your library component at least once in order to be able to import it as a module into a different project. Remember that the **package.json** says that `"main": "lib/index.js"`, therefore, that ___location needs to exist prior to any **import** attempt.
55+
1. Right after creating the symbolic link to your new SPFx library component, don't forget to run at least once `gulp build`. Compile your library component at least once in order to be able to import it as a module into a different project. Remember that the **package.json** says that `"main": "lib/index.js"`, therefore, that ___location needs to exist prior to any **import** attempt.
5656
1. This will create a local npm link to the library with the name, which is provided in the **package.json**.
5757
1. Create a web part project in a **separate project folder, so not in the library project folder structure**, following the instructions from [here](https://docs.microsoft.com/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part#to-create-a-new-web-part-project). Name your web part **CorporateWebPart**.
5858
1. From the root of the new web part folder, run the command `npm link corporate-library`

0 commit comments

Comments
 (0)