diff --git a/package-lock.json b/package-lock.json index 1da5d5be1c5d3772395d954677aef4f451a7ba62..6558c4bc4fcf8c6f35afdf000c314437ffb22ffc 100644 Binary files a/package-lock.json and b/package-lock.json differ diff --git a/package.json b/package.json index 7f7083981e95cc500350361f17b10e3eff29a452..b139054660070dab572be66c51017642c92bcb75 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,6 @@ "raw-loader": "^1.0.0", "resolve-url-loader": "^3.0.0", "sass-loader": "^7.1.0", - "string-replace-loader": "^2.1.1", "style-loader": "^0.23.1", "ts-jest": "^23.10.5", "tslint": "^5.12.1", diff --git a/src/mol-plugin/context.ts b/src/mol-plugin/context.ts index 46e16196c2021c5ded91ff4771aee709a2f38cb1..2749c5eee811344b9646c7a403a3cbb11eed5b72 100644 --- a/src/mol-plugin/context.ts +++ b/src/mol-plugin/context.ts @@ -182,7 +182,7 @@ export class PluginContext { this.lociLabels = new LociLabelManager(this); // TODO: find a better solution for this. - setTimeout(() => this.log.message(`Mol* Plugin ${PLUGIN_VERSION} [${PLUGIN_VERSION_DATE}]`), 500); + setTimeout(() => this.log.message(`Mol* Plugin ${PLUGIN_VERSION} [${PLUGIN_VERSION_DATE.toLocaleString()}]`), 500); } // settings = ; diff --git a/src/mol-plugin/version.ts b/src/mol-plugin/version.ts index 26b3a278fa756d18483913935f0542796e8a8ab9..fe3cfb827da23a0837aceacd75f69a5faf90c779 100644 --- a/src/mol-plugin/version.ts +++ b/src/mol-plugin/version.ts @@ -1,8 +1,12 @@ /** - * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info. + * Copyright (c) 2018-2019 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal <david.sehnal@gmail.com> + * @author Alexander Rose <alexander.rose@weirdbyte.de> */ export const PLUGIN_VERSION = '0.5.0'; -export const PLUGIN_VERSION_DATE = '$PLUGIN_VERSION_DATE$'; \ No newline at end of file +/** 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__; +export const PLUGIN_VERSION_DATE = new Date(PLUGIN_VERSION_TIMESTAMP); \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index b82967adcfb5d06a6480d21ea1fa65173529f11e..3a2db252989711386f98d744c3c559fb6858991a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,4 +1,5 @@ const path = require('path'); +const webpack = require('webpack'); const ExtraWatchWebpackPlugin = require('extra-watch-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); // const CircularDependencyPlugin = require('circular-dependency-plugin'); @@ -28,15 +29,7 @@ const sharedConfig = { { test: /\.(s*)css$/, use: [MiniCssExtractPlugin.loader, 'css-loader', 'resolve-url-loader', 'sass-loader'] - }, - { - test: /version\.js$/, - loader: 'string-replace-loader', - options: { - search: '$PLUGIN_VERSION_DATE$', - replace: function (date) { return date.getFullYear() + '/' + (date.getMonth() + 1) + '/' + date.getDate() } (new Date()), - } - } + } ] }, plugins: [ @@ -54,6 +47,9 @@ const sharedConfig = { './build/src/**/*.html' ], }), + new webpack.DefinePlugin({ + __PLUGIN_VERSION_TIMESTAMP__: webpack.DefinePlugin.runtimeValue(() => `${new Date().valueOf()}`, true), + }), new MiniCssExtractPlugin({ filename: 'app.css' }) ], resolve: {