Replies: 2 comments 1 reply
-
This seems to be a fairly common problem among libraries/apps that when source code is compiled from many files into one bundle, the license comment from each one of those files makes it into the final bundled file. I'll look around to see if there's a standard solution but if you know of one off the bat, let me know. Otherwise at first glance, it looks like the simplest way is to use a terser plugin to strip the comments, and then add back one overall license comment at the top in some kind of post processing step. I think I've tried this before on the CDN bundles though and adding the license back at the end screws up the source map. |
Beta Was this translation helpful? Give feedback.
-
For anyone using esbuild (or Vite), setting https://esbuild.github.io/api/#legal-comments I was able to reduce my Firebase chunk from 217KB to 156KB with this setting. |
Beta Was this translation helpful? Give feedback.
-
I'm using Firebase in a fairly simple web application for authentication and document storage.
The bundle size is pretty big - 800kB. After checking inside the files, I noticed that the Apache License Notice appears 270 times. That alone increases the file size 150kB.
webpack preserves comments with the @license flag in production mode, but this feels utterly wrong.
Has anybody else encountered the same problem?
Beta Was this translation helpful? Give feedback.
All reactions