Closed mitar closed 7 months ago
This is your responsibility to configure: https://vitejs.dev/config/shared-options#esbuild https://esbuild.github.io/api/#legal-comments
Thanks. Adding:
esbuild: {
legalComments: "none",
},
Removed the comment.
FYI you do need them in the source code for legal compliance. I don't personally care about it, especially given it's MIT 😄 but there are still some rules to follow. In doubt, consult with an intellectual property attorney
Yes, if you remove the copyright notice from the minimized code as mentioned above, then you have to include copyright notices somewhere else in your web app. I find this a better trade-off, but it does require a bit more work from me as a developer. (But at the same time I can make sure I include all notices and not just those which happen to configure rollup to include the banner.)
What problem is this solving
I use Vite with vue-router and when I am building for production, I see the following banner in the output bundle:
Given that the rest of the file is minimized, this is 87 bytes I think I do not need in my final bundle. My app is open source and it lists packages and their licensed used in the repository. I do not think there is a need to have it also listed in minimized bundle.
Proposed solution
I could not find any documentation nor an option to suppress this banner. It seems it is configured here but I do not see a way for this configuration to be changed from Vite. So I suggest this is made configurable. Maybe through an environment variable? Or maybe in production mode it should not be issued at all?
Describe alternatives you've considered
I tried rollup-plugin-strip-banner plugin, but it does not seem to work in this particular case. Maybe there are simply too many layers between vite, rollup, and this plugin.