Skip to content

Commit

Permalink
feat: add enable cache buster (#467)
Browse files Browse the repository at this point in the history
* [feature] - add enable cache buster

* Update client-version.js

* typo and remove comment

* fix indent to make it same as before

---------

Co-authored-by: nwattanuyan <nattaaek.wattanuyan@agoda.com>
  • Loading branch information
nattaaek and nwattanuyan committed Sep 13, 2023
1 parent d6b649c commit 941643a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dashboard-plugin/client-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ module.exports = ({
fallbackEntryURL,
fallbackRemoteVar,
dashboardTimeout,
fallbackEnableCacheBuster,
}) => {
fallbackRemoteVar = fallbackRemoteVar || remoteName;
fallbackEntryURL = fallbackEntryURL || '';
fallbackEnableCacheBuster = fallbackEnableCacheBuster || false;
if (!dashboardTimeout) {
dashboardTimeout = -1;
}
Expand Down Expand Up @@ -75,6 +77,11 @@ module.exports = ({
if (!fallbackEntryURL) return Promise.reject(error);
var name = '${fallbackRemoteVar}';
var url = new URL(fallbackEntryURL);
if (${fallbackEnableCacheBuster}) {
var cacheBuster = Date.now();
url.searchParams.append('cacheBuster', cacheBuster);
}
new Promise(function (resolve, reject) {
var __webpack_error__ = new Error();
Expand Down

0 comments on commit 941643a

Please sign in to comment.