1
0

fix locales versioning in service worker

This commit is contained in:
Hazelnoot
2024-10-15 21:39:20 -04:00
parent b5a1c54d65
commit 45ac7e50bc
4 changed files with 6 additions and 2 deletions
+2
View File
@@ -9,6 +9,7 @@ import { fileURLToPath } from 'node:url';
import * as esbuild from 'esbuild';
import locales from '../../locales/index.js';
import meta from '../../package.json' with { type: 'json' };
import { localesVersion } from '../../locales/version.js';
const watch = process.argv[2]?.includes('watch');
const __dirname = fileURLToPath(new URL('.', import.meta.url));
@@ -23,6 +24,7 @@ const buildOptions = {
_DEV_: JSON.stringify(process.env.NODE_ENV !== 'production'),
_ENV_: JSON.stringify(process.env.NODE_ENV ?? ''), // `NODE_ENV`が`undefined`なとき`JSON.stringify`が`undefined`を返してエラーになってしまうので`??`を使っている
_LANGS_: JSON.stringify(Object.entries(locales).map(([k, v]) => [k, v._lang_])),
_LANGS_VERSION_: JSON.stringify(localesVersion),
_PERF_PREFIX_: JSON.stringify('Misskey:'),
_VERSION_: JSON.stringify(meta.version),
},