mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-02 08:06:00 +00:00
add: prod section at the end
This commit is contained in:
@@ -71,7 +71,7 @@ export type NextjsBkndConfig<Env = NextjsEnv> = FrameworkBkndConfig<Env> & {
|
|||||||
|
|
||||||
## Serve the API
|
## Serve the API
|
||||||
|
|
||||||
Create a helper file to instantiate the bknd instance and retrieve the API, importing the configurationfrom the `bknd.config.ts` file:
|
Create a helper file to instantiate the bknd instance and retrieve the API, importing the configuration from the `bknd.config.ts` file:
|
||||||
|
|
||||||
```ts title="src/bknd.ts"
|
```ts title="src/bknd.ts"
|
||||||
import {
|
import {
|
||||||
@@ -172,3 +172,26 @@ export default async function Home() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Note for Production
|
||||||
|
If your admin component is not rendering and has a error like `Identifier 'b' has already been declared`, you will need to add these lines to your `next.config.(mjs|ts)` file:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import type { NextConfig } from "next";
|
||||||
|
|
||||||
|
const nextConfig: NextConfig = {
|
||||||
|
// ...
|
||||||
|
// for turbopack
|
||||||
|
experimental: {
|
||||||
|
turbopackMinify: false,
|
||||||
|
},
|
||||||
|
|
||||||
|
// for webpack
|
||||||
|
// webpack: (config) => {
|
||||||
|
// config.optimization.minimize = false;
|
||||||
|
// return config;
|
||||||
|
// },
|
||||||
|
};
|
||||||
|
|
||||||
|
export default nextConfig;
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user