coderaiser/minify

Convert to ESM

Closed this issue · 4 comments

Would be amazing to convert minify to ESM. @putout/plugin-convert-commonjs-to-esm can help with it.

Hello @coderaiser, I would like to contribute to this issue, but i don't promise i'll do it correctly the first time

Hi @coderaiser, I'm done converting this, but there is one problem with the for loop

for (const name of ['js', 'html', 'css', 'img']) { minify[name] = require(DIR + name);

I have not found information on how to convert it to the esm module, so I changed these four files to commonjs with .cjs extension. Can it be like that?

You can use dynamic import for this purpose