Is 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?
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.