nivekcode / svg-to-ts

Build performant SVG icon libraries by converting raw SVG files to TypeScript that is optimized for modern tree shaking mechanisms.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Run within a module repository

Garbee opened this issue · comments

I seem to only be able to run the generator when the type is set to commonjs. Setting the package type to module always causes a configuration error, even if the config is named .cjs to force the commonjs loader.

Example: https://github.com/Garbee/material-icons

Steps to reproduce:

  1. git clone --recursive git clone --recursive https://github.com/Garbee/material-icons.git icons-test
  2. cd icons-test
  3. npm ci
  4. npm run icons

Does anyone know of a way to make this work while in a module package? Or will we need to change back to commonjs when running this for the time being?

I did some digging earlier and it looks like cosmiconfig is looking for maintainers and no longer actively maintained. There are some issues around module loading upstream. So this could be a non-issue here technically. However, an alternative config loader should be looked into if that is the case and cosmiconfig isn't actively maintained.

cosmiconfig landed support for cjs in 8.2.0 so all that's needed is a cosmiconfig dep version bump! cosmiconfig/cosmiconfig#224 (comment)