open-wc/custom-elements-manifest

Programmatically invoke the analyzer

Poliziano opened this issue · 3 comments

Hi - it is possible to invoke the analyzer from within TypeScript/JavaScript? I have a Vite plugin that I'm working on that produces the manifest during a build. I'm currently use child_process to the invoke the command which works fine, but preferably I would be able to directly call the analyzer. Is this reasonable/possible to do? Thanks!

Yes, you can read more about there: https://custom-elements-manifest.open-wc.org/analyzer/getting-started/#usage-in-the-browser

The title says "usage in the browser", but the usage is the same in Node

Unfortunately that didn't work for me.

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /node_modules/.pnpm/@custom-elements-manifest+analyzer@0.5.7/node_modules/@custom-elements-manifest/analyzer/browser/index.js