Skip to content

Commit

Permalink
Updated code transpilation for Next.js 13.1 or higher in readme file (#…
Browse files Browse the repository at this point in the history
…528)

* Updated code transpilation for Next.js 13.1 or higher

* docs: update readme for nextjs

---------

Co-authored-by: Zhou Fang <zhfaxb@syntronic.com>
Co-authored-by: hustcc <i@hust.cc>
  • Loading branch information
3 people authored Mar 5, 2025
1 parent 0aa380c commit b07584b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,21 @@ import 'echarts/lib/component/title';
/>
```

For **Next.js** user, code transpilation is needed.
For **Next.js** user, code transpilation is needed. For Next.js 13.1 or higher, as all `next-transpile-modules` features are natively built-in and the package has been deprecated, so please add `transpilePackages: ['echarts', 'zrender']` into `nextConfig` object:

```js
// next.config.js
/** @type {import('next').NextConfig} */

const nextConfig = {
// ...existing properties,
transpilePackages: ['echarts', 'zrender'],
}

module.exports = nextConfig
```

For Next.js with version < 13.1:

```js
// next.config.js
Expand Down

0 comments on commit b07584b

Please sign in to comment.