diff --git a/src/mol-plugin/version.ts b/src/mol-plugin/version.ts index 68e9c4b0dc17d0fad36fa9b8ec56c5538120b88f..a91782d7aca1f7e6cd91d311e8ea5d74813c25fc 100644 --- a/src/mol-plugin/version.ts +++ b/src/mol-plugin/version.ts @@ -5,8 +5,11 @@ * @author Alexander Rose <alexander.rose@weirdbyte.de> */ -export const PLUGIN_VERSION = '0.6.0'; +/** version from package.json, to be filled in at bundle build time */ +declare const __VERSION__: string +export const PLUGIN_VERSION = __VERSION__; + /** unix time stamp, to be filled in at bundle build time */ -declare const __PLUGIN_VERSION_TIMESTAMP__: number -export const PLUGIN_VERSION_TIMESTAMP = __PLUGIN_VERSION_TIMESTAMP__; +declare const __VERSION_TIMESTAMP__: number +export const PLUGIN_VERSION_TIMESTAMP = __VERSION_TIMESTAMP__; export const PLUGIN_VERSION_DATE = new Date(PLUGIN_VERSION_TIMESTAMP); \ No newline at end of file diff --git a/webpack.config.common.js b/webpack.config.common.js index 386a5a8d8c4a9ad1b90a1eaf4b48ef21d23e2cf1..685b48184bba4bd937517ea9e366f6b0ac02cdab 100644 --- a/webpack.config.common.js +++ b/webpack.config.common.js @@ -36,7 +36,8 @@ const sharedConfig = { ], }), new webpack.DefinePlugin({ - __PLUGIN_VERSION_TIMESTAMP__: webpack.DefinePlugin.runtimeValue(() => `${new Date().valueOf()}`, true), + __VERSION__: JSON.stringify(require('./package.json').version), + __VERSION_TIMESTAMP__: webpack.DefinePlugin.runtimeValue(() => `${new Date().valueOf()}`, true), 'process.env.DEBUG': JSON.stringify(process.env.DEBUG) }), new MiniCssExtractPlugin({ filename: 'app.css' })