Dschungelabenteuer / vite-plugin-entry-shaking

Mimic tree-shaking behaviour when importing code from an entry file in development mode.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Splitchunk lazyload from index.ts not working

nguyenbatranvan opened this issue · comments

i have files

  1. src/components/chart/chart-1.tsx
  2. src/components/chart/chart-2.tsx

and i export from src/components/chart/index.ts

  1. export {Chart1} from "./chart-1"

  2. export {Chart2} from "./chart-2"

and then, i import in app.tsx
import {Chart1} from "./components/chart"

working well. But i using lazy load react
const Chart1 = lazy(() => import("./components/chart").then(m => ({default: m.Chart1})))

have a error
Uncaught SyntaxError: Unexpected token ';' const Chart1 = lazy(_c = () => ;then((m) => ({ default: m.Chart1 })));
What do I need to do with this?