rollup-plugin-visualizer
rollup-plugin-visualizer copied to clipboard
ESM migration
I currently blocked from updating open and yargs to latest versions, as they started to use ESM.
I tried in v6 to use require(esm), but there was data points that shows that it is not always possible to simply update node version.
Some guide: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-make-my-typescript-project-output-esm
I will probabaly need to take a look how users current consume package. This should include vite, rollup, rolldown.
As a side note i will probably deprecate old rollup version.
Vite and Rolldown supports import/export out of the box
ESM Rollup https://github.com/plouc/nivo/blob/a2d9dab855365926cb41267eb20af154ca8fd558/conf/rollup.config.mjs#L7
Rollup JS, Vite https://github.com/antvis/G2/blob/7ae3e0854480e3c06b79d315cb66825b3051177a/rollup.config.js#L4
Vite https://github.com/vbenjs/vue-vben-admin/blob/8ba7bdf2bdc3dc23ed174b8cbac34b1b1b429208/internal/vite-config/src/plugins/index.ts#L13
Rollup ESM https://github.com/mrdoob/three.js/blob/88cf6d03da0a2701353c4df80287ccb704c7ca56/test/rollup.treeshake.config.js#L5
Vite https://github.com/search?q=repo%3Aballerine-io%2Fballerine+rollup-plugin-visualizer&type=code
Given that Vite is now ESM-only and every Node version that doesn't support require(esm) is EOL, wouldn't it make sense to eventually migrate for sure (major version bump with just ESM only as breaking change)?
@TheAlexLichter yes i do plan do this with v7