Skip to content

Commit

Permalink
Merge pull request #324 from 3DStreet/sweep/add-console-log
Browse files Browse the repository at this point in the history
Add console log for npm version number and github hash
  • Loading branch information
kfarr committed Aug 8, 2023
2 parents ebdbe25 + 0eebcb5 commit 3d4432e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* global AFRAME, THREE, XMLHttpRequest */
if (typeof VERSION !== 'undefined') { console.log(`3DStreet Version: ${VERSION} (Date: ${new Date(COMMIT_DATE).toISOString().split('T')[0]}, Commit Hash: #${COMMIT_HASH})`); }
var streetmixParsers = require('./aframe-streetmix-parsers');
var streetmixUtils = require('./tested/streetmix-utils');
require('./components/anisotropy');
Expand Down
16 changes: 14 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path');
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');

module.exports = {
Expand All @@ -14,6 +15,17 @@ module.exports = {
]
},
optimization: {
minimizer: [new TerserPlugin({ extractComments: false })],
}
minimizer: [new TerserPlugin({ extractComments: false })]
},
plugins: [
new webpack.DefinePlugin({
VERSION: JSON.stringify(process.env.npm_package_version)
}),
new webpack.DefinePlugin({
COMMIT_DATE: JSON.stringify(require('child_process').execSync('git log -1 --format=%cd').toString().trim())
}),
new webpack.DefinePlugin({
COMMIT_HASH: JSON.stringify(require('child_process').execSync('git rev-parse --short HEAD').toString().trim())
})
]
};

0 comments on commit 3d4432e

Please sign in to comment.