Skip to content

Commit 569777c

Browse files
committed
add info about importing npm libraries
1 parent f628ca9 commit 569777c

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

docs/guide/preloading.mdx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Preloading Assets
22

3-
43
Textures, sounds, and other assets can be preloaded by defining a `preload.ts` file in the root of your project
54

65
```ts
@@ -9,6 +8,17 @@ export default definePreload({
98
// ... sounds, etc
109
custom: async () => {
1110
// custom preloading goes here
12-
}
11+
},
1312
});
14-
```
13+
```
14+
15+
## Importing npm Libraries
16+
17+
You can import external npm packages in your scripts by using the `npm:` prefix before the package name:
18+
19+
```ts
20+
import nipplejs from "npm:nipplejs";
21+
```
22+
23+
This works with any npm package and allows you to use external libraries in your Dreamlab project. The package will be
24+
automatically fetched and loaded when your script runs.

0 commit comments

Comments
 (0)