From 47057989af916bbdf7f65edd3b6d99f5a6e87485 Mon Sep 17 00:00:00 2001 From: Rikin Kachhia Date: Mon, 19 Aug 2019 14:40:41 +0530 Subject: [PATCH] set console asset version as build timestamp (#2742) --- console/webpack/dev.config.js | 8 +------- console/webpack/prod.config.js | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/console/webpack/dev.config.js b/console/webpack/dev.config.js index 985ea99e213..14ced6ade4c 100755 --- a/console/webpack/dev.config.js +++ b/console/webpack/dev.config.js @@ -20,12 +20,6 @@ const webpackIsomorphicToolsPlugin = new WebpackIsomorphicToolsPlugin( // const { UnusedFilesWebpackPlugin } = require('unused-files-webpack-plugin'); -const getRandomHexString = () => { - return Math.random() - .toString(16) - .slice(2); -}; - module.exports = { mode: 'development', devtool: 'inline-source-map', @@ -155,7 +149,7 @@ module.exports = { }), // set global consts new webpack.DefinePlugin({ - CONSOLE_ASSET_VERSION: JSON.stringify(getRandomHexString()), + CONSOLE_ASSET_VERSION: Date.now().toString(), }), webpackIsomorphicToolsPlugin.development(), ], diff --git a/console/webpack/prod.config.js b/console/webpack/prod.config.js index 929c5a1f49d..a3faa3b798e 100755 --- a/console/webpack/prod.config.js +++ b/console/webpack/prod.config.js @@ -22,12 +22,6 @@ const cleanOptions = { dry: false, }; -const getRandomHexString = () => { - return Math.random() - .toString(16) - .slice(2); -}; - module.exports = { mode: 'production', context: path.resolve(__dirname, '..'), @@ -193,7 +187,7 @@ module.exports = { // Useful to reduce the size of client-side libraries, e.g. react NODE_ENV: JSON.stringify('production'), }, - CONSOLE_ASSET_VERSION: JSON.stringify(getRandomHexString()), + CONSOLE_ASSET_VERSION: Date.now().toString(), }), ], };