Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: nexjs bundling config #26

Merged
merged 3 commits into from
Jan 21, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
- [Installation](#installation)
- [Platform Support](#platform-support)
- [Usage](#usage)
- [Logging](#logging)
- [Builds and bundling](#builds-and-bundling)
- [Examples](#examples)
- [Contributing](#contributing)
- [License](#license)
Expand Down Expand Up @@ -237,6 +239,36 @@ await configure({
})
```

## Builds and bundling

### Next.js

Using `@cipherstash/jseql` with Next.js? Since the package is a native Node.js module, you need to opt-out from the Server Components bundling and use native Node.js `require` instead.

#### Using version 15 or later

`next.config.ts` [configuration](https://nextjs.org/docs/app/api-reference/config/next-config-js/serverExternalPackages):

```js
const nextConfig = {
...
serverExternalPackages: ['@cipherstash/jseql'],
}
```

#### Using version 14

`next.config.mjs` [configuration](https://nextjs.org/docs/14/app/api-reference/next-config-js/serverComponentsExternalPackages):

```js
const nextConfig = {
...
experimental: {
serverComponentsExternalPackages: ['@cipherstash/jseql'],
},
}
```

## Examples

- [Basic example](/apps/basic)
Expand Down
Loading