ecomfe / fontmin

Minify font seamlessly
http://ecomfe.github.io/fontmin
MIT License
5.74k stars 315 forks source link

fix: refactor cli.js to esm #110

Open meowtec opened 1 year ago

meowtec commented 1 year ago

@kekee000 take a look at this?

C0rn3j commented 6 months ago
[0] % fontmin --help
/usr/lib/node_modules/fontmin/cli.js:13
var meow = require('meow');
           ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /usr/lib/node_modules/fontmin/node_modules/meow/index.js from /usr/lib/node_modules/fontmin/cli.js not supported.
Instead change the require of index.js in /usr/lib/node_modules/fontmin/cli.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/usr/lib/node_modules/fontmin/cli.js:13:12) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v21.7.1

Without this PR, I get this issue on 1.0.1.

@kekee000 friendly second ping to hopefully get this sorted