Convert to ESM
Closed this issue · 4 comments
coderaiser commented
Would be amazing to convert minify
to ESM
. @putout/plugin-convert-commonjs-to-esm can help with it.
Zapotoczny-Rafal commented
Hello @coderaiser, I would like to contribute to this issue, but i don't promise i'll do it correctly the first time
Zapotoczny-Rafal commented
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?
coderaiser commented
You can use dynamic import for this purpose
coderaiser commented
✅