Skip to content

Commit b47ea28

Browse files
committed
chore: remove optimizeDeps config for an obsolete error in README
1 parent 0571a78 commit b47ea28

File tree

1 file changed

+20
-42
lines changed

1 file changed

+20
-42
lines changed

README.md

Lines changed: 20 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -276,26 +276,26 @@ Each chart type has its own import that matches the type name you pass to the co
276276

277277
**Chart types:**
278278

279-
| Import | type string |
280-
|--------|-------------|
281-
| `apexcharts/line` | `"line"` |
282-
| `apexcharts/area` | `"area"` |
283-
| `apexcharts/scatter` | `"scatter"` |
284-
| `apexcharts/bubble` | `"bubble"` |
285-
| `apexcharts/rangeArea` | `"rangeArea"` |
286-
| `apexcharts/bar` | `"bar"` |
287-
| `apexcharts/column` | `"column"` |
288-
| `apexcharts/barStacked` | `"barStacked"` |
289-
| `apexcharts/rangeBar` | `"rangeBar"` |
290-
| `apexcharts/pie` | `"pie"` |
291-
| `apexcharts/donut` | `"donut"` |
292-
| `apexcharts/polarArea` | `"polarArea"` |
293-
| `apexcharts/radialBar` | `"radialBar"` |
294-
| `apexcharts/radar` | `"radar"` |
279+
| Import | type string |
280+
| ------------------------ | --------------- |
281+
| `apexcharts/line` | `"line"` |
282+
| `apexcharts/area` | `"area"` |
283+
| `apexcharts/scatter` | `"scatter"` |
284+
| `apexcharts/bubble` | `"bubble"` |
285+
| `apexcharts/rangeArea` | `"rangeArea"` |
286+
| `apexcharts/bar` | `"bar"` |
287+
| `apexcharts/column` | `"column"` |
288+
| `apexcharts/barStacked` | `"barStacked"` |
289+
| `apexcharts/rangeBar` | `"rangeBar"` |
290+
| `apexcharts/pie` | `"pie"` |
291+
| `apexcharts/donut` | `"donut"` |
292+
| `apexcharts/polarArea` | `"polarArea"` |
293+
| `apexcharts/radialBar` | `"radialBar"` |
294+
| `apexcharts/radar` | `"radar"` |
295295
| `apexcharts/candlestick` | `"candlestick"` |
296-
| `apexcharts/boxPlot` | `"boxPlot"` |
297-
| `apexcharts/heatmap` | `"heatmap"` |
298-
| `apexcharts/treemap` | `"treemap"` |
296+
| `apexcharts/boxPlot` | `"boxPlot"` |
297+
| `apexcharts/heatmap` | `"heatmap"` |
298+
| `apexcharts/treemap` | `"treemap"` |
299299

300300
**Optional features:**
301301
| Import | Description |
@@ -306,29 +306,7 @@ Each chart type has its own import that matches the type name you pass to the co
306306
| `apexcharts/features/exports` | PNG/SVG/CSV export |
307307
| `apexcharts/features/keyboard` | Keyboard navigation & accessibility |
308308

309-
> **Note:** Tree-shaking requires ApexCharts v5.8.1+.
310-
311-
### Vite: preventing "chart type X is not registered" errors
312-
313-
Vite's dependency pre-bundler can create two separate copies of the ApexCharts module — one for `apexcharts/core` and separate ones for each sub-entry — causing registrations to be lost. If you see this error even though you have the correct imports, add your apexcharts entries to `optimizeDeps.include`:
314-
315-
```js
316-
// vite.config.js
317-
export default {
318-
optimizeDeps: {
319-
include: [
320-
'apexcharts/core',
321-
'apexcharts/line',
322-
'apexcharts/bar',
323-
// ...all apexcharts/* entries you import
324-
'apexcharts/features/legend',
325-
'apexcharts/features/toolbar',
326-
],
327-
},
328-
}
329-
```
330-
331-
This forces Vite to pre-bundle all sub-entries together so they share a single ApexCharts instance and all registrations are preserved.
309+
> **Note:** Tree-shaking requires ApexCharts v5.10.3+.
332310
333311
## Server-Side Rendering (SSR)
334312

0 commit comments

Comments
 (0)