antfu-collective / vite-plugin-inspect

Inspect the intermediate state of Vite plugins
MIT License
1.29k stars 75 forks source link

feat: move to ESM first #91

Closed userquin closed 1 year ago

userquin commented 1 year ago

Right now we have:

imagen

Moving to ESM first:

imagen

userquin commented 1 year ago

we should also update node to 16 or maybe to 18...

antfu commented 1 year ago

I am not sure. In many usage the vite.config.ts might be a CJS. Requiring for dynamic import is not really worth it to me. And I don't actually mind to have "Masqureading CJS types"

sxzz commented 1 year ago

@antfu We need to copy xxx.d.ts to xxx.d.mts. The first dts is for CJS and the second one is for ESM, like I done in unplugin

userquin commented 1 year ago

@sxzz maybe we can have CJS and ESM configured properly, something like this: https://github.com/fabian-hiller/valibot/pull/12#issuecomment-1652016724

antfu commented 1 year ago

On the opposite, https://github.com/unjs/unbuild/pull/273, I thought that TS will look for the corresponding types based on the file name in node16