trapeze icon indicating copy to clipboard operation
trapeze copied to clipboard

Reduce disk space

Open yandeu opened this issue 3 years ago • 5 comments

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

yandeu avatar May 18 '22 21:05 yandeu

Are you seeing this as bundle size in the built JS output, or just resident disk usage in node_modules?

mlynch avatar May 19 '22 02:05 mlynch

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.

yandeu avatar May 19 '22 09:05 yandeu

I suggest 2 things:

  • Replace prettier with 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

yandeu avatar May 19 '22 13:05 yandeu

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.

mlynch avatar May 19 '22 13:05 mlynch

it's pretty code formatting

Right, that's what I wanted to write :)

yandeu avatar May 19 '22 13:05 yandeu