Reduce disk space
Can't @prettier/plugin-xml this just be a dev dependency? It depends on prettier and occupies about 17 MB disk space.
https://github.com/ionic-team/capacitor-configure/blob/7d9b4c515c9bc60b8dbb454abba05ee928bccabe/packages/configure/package.json#L31
Similar for ts-node. It uses typescript as a peer dependency which is > 50 MB.
https://github.com/ionic-team/capacitor-configure/blob/7d9b4c515c9bc60b8dbb454abba05ee928bccabe/packages/configure/package.json#L42
Are you seeing this as bundle size in the built JS output, or just resident disk usage in node_modules?
Disk.
I'm about to optimize my cicd pipeline and am about to reduce download/cache size.
Downloading ~70 MB just for running npx cap-config run config.yml for few ms seems a lot.
I suggest 2 things:
- Replace
prettierwith another lightweight xml parser in. https://github.com/ionic-team/capacitor-configure/blob/main/packages/project/src/util/xml.ts - For
loadExtConfigTS(): Check if the config is TS; check if the user has TypeScript installed; if not, ask the user to install TypeScript and abort.
https://github.com/ionic-team/capacitor-configure/blob/main/packages/configure/src/capacitor.ts
Okay thanks, I'll consider it. It's not just parsing that I need, it's pretty code formatting. Since we modify your source files they better look good after modification otherwise the tool isn't achieving its goal.
it's pretty code formatting
Right, that's what I wanted to write :)