Adding version number into dist files #2722
Replies: 5 comments
-
You can look at the version in |
Beta Was this translation helpful? Give feedback.
-
No, I meant on production. Consider a case where your lib logic copies dist file to prod like a CDN server and use the file by adding it with a script tag into DOM |
Beta Was this translation helpful? Give feedback.
-
Most bundlers will automatically collect licenses from the different libraries and generate a file with all the licenses and the version. |
Beta Was this translation helpful? Give feedback.
-
I believe UMD version is not handled by bundlers when your bundling(or just copying) process just copies the dist file from node_modules to a public directory. Another case is, developer can download a file from CDN and then just puts it in the assets folder which will only get copied as an asset and not get bundled as a regular ESM file. In these case, developer won't add a version to its URL, and you'll have no way around to know the version |
Beta Was this translation helpful? Give feedback.
-
It can be done with the
This is React's:
Their version exists at runtime but not in the banner. |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
I'm unable to determine which version of Floating UI is used on DOM because the bundled files under dist directory doesn't contain a version info or it's hard to find out.
Describe the solution you'd like
Adding the library name and it's current version in a comment that doesn't increase the size would be awesome. I'm not talking about going full advertising of course (like adding owner details, github source link etc.) A person can always search for a library by it's name and it's already sufficient enough
Describe alternatives you've considered
Adding version number into filename but that can impact apps that doesn't automatically handles libraries based on their version numbers. So it might be a breaking change.
Beta Was this translation helpful? Give feedback.
All reactions