Skip to content

Commit

Permalink
chore(webpack): destruct version from pkgJson (#7713)
Browse files Browse the repository at this point in the history
  • Loading branch information
evenstensberg authored May 7, 2024
1 parent b3d3465 commit 17bc6cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .webpack/webpack.common.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { merge } from 'webpack-merge';
let gitRevision = 'error-retrieving-revision';
let gitBranch = 'error-retrieving-branch';

const packageDefinition = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url)));
const { version } = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url)));

try {
gitRevision = execSync('git rev-parse HEAD').toString().trim();
Expand Down Expand Up @@ -85,7 +85,7 @@ const config = {
},
plugins: [
new webpack.DefinePlugin({
__OPENMCT_VERSION__: `'${packageDefinition.version}'`,
__OPENMCT_VERSION__: `'${version}'`,
__OPENMCT_BUILD_DATE__: `'${new Date()}'`,
__OPENMCT_REVISION__: `'${gitRevision}'`,
__OPENMCT_BUILD_BRANCH__: `'${gitBranch}'`,
Expand Down

0 comments on commit 17bc6cb

Please sign in to comment.