vite-plugin-externals
vite-plugin-externals copied to clipboard
Esmodule hoisting
Hi Crcong, I was using your excellent plugin in my own project, thanks for the work!
Since the esbuild used by vite is relying on the hoisted feature of esmodule, see https://github.com/evanw/esbuild/issues/1395#issuecomment-869026051, there would a chance the error: cannot access xxx before initialization
will be occurred if we just replace the import statments with const declaration inline. Any thoughts on this?
I can give an example if needed
any updates on this ?
any updates on this ?
I just append the new statement to the start of the file https://github.com/suguanYang/next-web/blob/834df2c753025536af2ff4f49df7faffa05536ad/packages/server/src/config/plugins/vite-plugin-externals/index.ts#L63