Skip to content

Commit 1df11aa

Browse files
committed
tweak words
1 parent 6a787f8 commit 1df11aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/imports.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ Or to import Apache Arrow:
8787
import * as Arrow from "apache-arrow";
8888
```
8989

90+
<div class="note">Not all Node packages are usable in the browser; Node imports are only supported for modules that do not rely on Node-specific APIs and that can be converted to ES modules via <a href="https://esbuild.github.io/">esbuild</a>. If you have difficulty importing a module, please ask for help by <a href="https://github.com/observablehq/framework/discussions">opening a discussion</a>.</div>
91+
9092
You can also import specific [entry points](https://nodejs.org/api/packages.html#package-entry-points) by adding the entry point subpath after the package name. For example, to import mime’s `lite` entry point:
9193

9294
```js run=false
@@ -95,8 +97,6 @@ import mime from "mime/lite";
9597

9698
Unlike `npm:` imports, Node imports do not support semver ranges: the imported version is determined by what is installed in your `node_modules` directory. Use your package manager (_e.g._, edit your `package.json` and run `npm install`, or run `npm update`) to change which version is imported.
9799

98-
Framework (via [esbuild](https://esbuild.github.io/)) automatically converts CommonJS to ES modules. However, not all Node packages are usable in the browser; Node imports are only supported for browser-compatible modules that do not rely on Node-specific APIs. If you have difficulty importing a module, please ask for help by [opening a discussion](https://github.com/observablehq/framework/discussions).
99-
100100
Imports from `node_modules` are cached in `.observablehq/cache/_node` within your [source root](./config#root) (`docs` by default). You shouldn’t need to clear this cache as it is automatically managed, but feel free to clear it you like.
101101

102102
## Local imports

0 commit comments

Comments
 (0)