diff --git a/packages/zone.js/rollup-es5.config.js b/packages/zone.js/rollup-es5.config.js index 0e39016fcd..8e86e499f5 100644 --- a/packages/zone.js/rollup-es5.config.js +++ b/packages/zone.js/rollup-es5.config.js @@ -1,8 +1,21 @@ const node = require('rollup-plugin-node-resolve'); const commonjs = require('rollup-plugin-commonjs'); +// Parse the stamp file produced by Bazel from the version control system +let version = ''; +if (bazel_stamp_file) { + const versionTag = require('fs') + .readFileSync(bazel_stamp_file, {encoding: 'utf-8'}) + .split('\n') + .find(s => s.startsWith('BUILD_SCM_VERSION')); + // Don't assume BUILD_SCM_VERSION exists + if (versionTag) { + version = versionTag.split(' ')[1].trim(); + } +} + const banner = `/** -* @license Angular v0.0.0-PLACEHOLDER +* @license Angular v${version} * (c) 2010-2019 Google LLC. https://angular.io/ * License: MIT */`; diff --git a/packages/zone.js/rollup-es5_global-es2015.config.js b/packages/zone.js/rollup-es5_global-es2015.config.js index 60c76e18df..729415f95d 100644 --- a/packages/zone.js/rollup-es5_global-es2015.config.js +++ b/packages/zone.js/rollup-es5_global-es2015.config.js @@ -1,8 +1,21 @@ const node = require('rollup-plugin-node-resolve'); const commonjs = require('rollup-plugin-commonjs'); +// Parse the stamp file produced by Bazel from the version control system +let version = ''; +if (bazel_stamp_file) { + const versionTag = require('fs') + .readFileSync(bazel_stamp_file, {encoding: 'utf-8'}) + .split('\n') + .find(s => s.startsWith('BUILD_SCM_VERSION')); + // Don't assume BUILD_SCM_VERSION exists + if (versionTag) { + version = versionTag.split(' ')[1].trim(); + } +} + const banner = `/** -* @license Angular v0.0.0-PLACEHOLDER +* @license Angular v${version} * (c) 2010-2019 Google LLC. https://angular.io/ * License: MIT */`;