diff --git a/package.json b/package.json index 11651e0..313af48 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,8 @@ "scripts": { "start": "react-scripts start", "prebuild": "node ./build-version", - "build": "set \"GENERATE_SOURCEMAP=false\" && set \"REACT_APP_VERSION=$npm_package_version\" && react-scripts build", - "host": "CI=false GENERATE_SOURCEMAP=false REACT_APP_VERSION=$npm_package_version npm run prebuild && react-scripts build", + "build": "set \"GENERATE_SOURCEMAP=false\" && set \"REACT_APP_VERSION=$npm_package_version\" && npm run prebuild && react-scripts build", + "host": "CI=false GENERATE_SOURCEMAP=false REACT_APP_VERSION=$npm_package_version react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, diff --git a/public/meta.json b/public/meta.json new file mode 100644 index 0000000..ac547bf --- /dev/null +++ b/public/meta.json @@ -0,0 +1 @@ +{"version":"0.2.4"} \ No newline at end of file diff --git a/src/Hooks/useCacheBuster.js b/src/Hooks/useCacheBuster.js index eaf5738..83ddb96 100644 --- a/src/Hooks/useCacheBuster.js +++ b/src/Hooks/useCacheBuster.js @@ -2,6 +2,7 @@ import { useEffect } from 'react'; import { useLocation } from 'react-router-dom'; const useCacheBuster = () => { + console.log("cache----buster") const location = useLocation(); const parseVersion = (str) => +str.replace(/\D/g, ''); const version = process.env.REACT_APP_VERSION; @@ -14,8 +15,9 @@ const useCacheBuster = () => { const metaVersion = parseVersion(meta.version); const packageVersion = parseVersion(version); if (packageVersion < metaVersion) { + console.log(packageVersion, metaVersion) if (window?.location?.reload) { - window.location.reload(); + // window.location.reload(); } } }