Make Release Version More Obvious in Build Output
See original GitHub issueIs your feature request related to a problem? Please describe.
Currently in the build output (e.g. three.js
), there’s no way to tell what the version of three.js is.
EDIT: Currently in the build output (e.g. three.js
), it’s not immediately obvious what the release version or “revision” is.
Describe the solution you’d like
I would like to see some version information included at the top of the source file.
// threejs.org/license
// version: 0.125.2
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
...
For example, we could reference version
in package.json
at the time of the build.
An example proposal would be in utils/build/rollup.config.js:
import pkg from "../../package.json";
...
function header() {
return {
renderChunk( code ) {
return (
'// threejs.org/license\n' +
`// version: ${pkg.version}\n` +
code
);
}
};
}
Describe alternatives you’ve considered
We could potentially use information from git like the latest tag or commit hash.
There may be a Rollup plugin we can include for this purpose: https://www.npmjs.com/package/rollup-plugin-version-injector
The point is to include some indication of the version in the build output .js
file.
Any thoughts on this?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
That is super handy! I had no idea this existed.
Thank you again for you helpfulness!
@gonnavis This seems reasonable, but I’m not very concerned with it. I do appreciate your input here as well!
For context, I’m completely new to Three.js, but I wouldn’t look for the version to be re-defined by a source code variable. I searched for “r125” originally in the file, and failed to search for “125”.
I’m more than satisfied with the responses and help from @Mugen87. 😃
Feel free to re-open if anyone wants more discussion.
Hello @Mugen87 , thank you for reminding me of this plug-in, I remember that there is a way to automatically print out REVISION, but I can’t recall it.
I currently have no difficulty finding the version number from the
THREE.REVISION
or source code. But I think as a newcomer, will probably look forVERSION
instead ofREVISION
, and should not know the existence of three.js developer tools, at least that’s how I was at the beginning.How about add such as
export const VERSION = REVISION;
as an alias atconstants.js
line 2?