rollup-plugin-visualizer icon indicating copy to clipboard operation
rollup-plugin-visualizer copied to clipboard

ESM migration

Open btd opened this issue 5 months ago • 5 comments

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

btd avatar Jun 09 '25 13:06 btd

ESM Rollup https://github.com/plouc/nivo/blob/a2d9dab855365926cb41267eb20af154ca8fd558/conf/rollup.config.mjs#L7

btd avatar Jun 09 '25 13:06 btd

Rollup JS, Vite https://github.com/antvis/G2/blob/7ae3e0854480e3c06b79d315cb66825b3051177a/rollup.config.js#L4

btd avatar Jun 09 '25 13:06 btd

Vite https://github.com/vbenjs/vue-vben-admin/blob/8ba7bdf2bdc3dc23ed174b8cbac34b1b1b429208/internal/vite-config/src/plugins/index.ts#L13

btd avatar Jun 09 '25 13:06 btd

Rollup ESM https://github.com/mrdoob/three.js/blob/88cf6d03da0a2701353c4df80287ccb704c7ca56/test/rollup.treeshake.config.js#L5

btd avatar Jun 09 '25 13:06 btd

Vite https://github.com/search?q=repo%3Aballerine-io%2Fballerine+rollup-plugin-visualizer&type=code

btd avatar Jun 09 '25 13:06 btd

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 avatar Oct 07 '25 12:10 TheAlexLichter

@TheAlexLichter yes i do plan do this with v7

btd avatar Oct 16 '25 09:10 btd