mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-08 05:03:39 +08:00
fix: client version potentially being different during build
!nuf
This commit is contained in:
parent
e5d8bd332f
commit
4cca5809a8
1 changed files with 5 additions and 5 deletions
|
|
@ -20,7 +20,7 @@ function pad(numbers, maxLength, fillString) {
|
|||
);
|
||||
}
|
||||
|
||||
function buildClientVersion() {
|
||||
const CLIENT_VERSION = (() => {
|
||||
const date = new Date();
|
||||
const versionPrefix = pad(
|
||||
[date.getFullYear(), date.getMonth() + 1, date.getDate()],
|
||||
|
|
@ -41,7 +41,7 @@ function buildClientVersion() {
|
|||
} catch (e) {
|
||||
return `${version}_unknown-hash`;
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
/** Enable for font awesome v6 */
|
||||
/*
|
||||
|
|
@ -68,7 +68,7 @@ export default {
|
|||
apply: "build",
|
||||
|
||||
closeBundle() {
|
||||
const version = buildClientVersion();
|
||||
const version = CLIENT_VERSION;
|
||||
const versionJson = JSON.stringify({ version });
|
||||
const versionPath = path.resolve(__dirname, "dist/version.json");
|
||||
writeFileSync(versionPath, versionJson);
|
||||
|
|
@ -147,7 +147,7 @@ export default {
|
|||
org: "monkeytype",
|
||||
project: "frontend",
|
||||
release: {
|
||||
name: buildClientVersion(),
|
||||
name: CLIENT_VERSION,
|
||||
setCommits: {
|
||||
commit: "HEAD",
|
||||
previousCommit: "HEAD^",
|
||||
|
|
@ -287,7 +287,7 @@ export default {
|
|||
process.env.BACKEND_URL || "https://api.monkeytype.com"
|
||||
),
|
||||
IS_DEVELOPMENT: JSON.stringify(false),
|
||||
CLIENT_VERSION: JSON.stringify(buildClientVersion()),
|
||||
CLIENT_VERSION: JSON.stringify(CLIENT_VERSION),
|
||||
RECAPTCHA_SITE_KEY: JSON.stringify(process.env.RECAPTCHA_SITE_KEY),
|
||||
QUICK_LOGIN_EMAIL: undefined,
|
||||
QUICK_LOGIN_PASSWORD: undefined,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue