fix(frontend): ビルド成果物のファイル名にlocalesのhashを含めるように (#16580)
This commit is contained in:
parent
0f8c068e84
commit
218070eb13
|
@ -64,6 +64,8 @@ function toBase62(n: number): string {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getConfig(): UserConfig {
|
export function getConfig(): UserConfig {
|
||||||
|
const localesHash = toBase62(hash(JSON.stringify(locales)));
|
||||||
|
|
||||||
return {
|
return {
|
||||||
base: '/embed_vite/',
|
base: '/embed_vite/',
|
||||||
|
|
||||||
|
@ -148,9 +150,9 @@ export function getConfig(): UserConfig {
|
||||||
// dependencies of i18n.ts
|
// dependencies of i18n.ts
|
||||||
'config': ['@@/js/config.js'],
|
'config': ['@@/js/config.js'],
|
||||||
},
|
},
|
||||||
entryFileNames: 'scripts/[hash:8].js',
|
entryFileNames: `scripts/${localesHash}-[hash:8].js`,
|
||||||
chunkFileNames: 'scripts/[hash:8].js',
|
chunkFileNames: `scripts/${localesHash}-[hash:8].js`,
|
||||||
assetFileNames: 'assets/[hash:8][extname]',
|
assetFileNames: `assets/${localesHash}-[hash:8][extname]`,
|
||||||
paths(id) {
|
paths(id) {
|
||||||
for (const p of externalPackages) {
|
for (const p of externalPackages) {
|
||||||
if (p.match.test(id)) {
|
if (p.match.test(id)) {
|
||||||
|
|
|
@ -85,6 +85,8 @@ export function toBase62(n: number): string {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getConfig(): UserConfig {
|
export function getConfig(): UserConfig {
|
||||||
|
const localesHash = toBase62(hash(JSON.stringify(locales)));
|
||||||
|
|
||||||
return {
|
return {
|
||||||
base: '/vite/',
|
base: '/vite/',
|
||||||
|
|
||||||
|
@ -188,9 +190,9 @@ export function getConfig(): UserConfig {
|
||||||
// dependencies of i18n.ts
|
// dependencies of i18n.ts
|
||||||
'config': ['@@/js/config.js'],
|
'config': ['@@/js/config.js'],
|
||||||
},
|
},
|
||||||
entryFileNames: 'scripts/[hash:8].js',
|
entryFileNames: `scripts/${localesHash}-[hash:8].js`,
|
||||||
chunkFileNames: 'scripts/[hash:8].js',
|
chunkFileNames: `scripts/${localesHash}-[hash:8].js`,
|
||||||
assetFileNames: 'assets/[hash:8][extname]',
|
assetFileNames: `assets/${localesHash}-[hash:8][extname]`,
|
||||||
paths(id) {
|
paths(id) {
|
||||||
for (const p of externalPackages) {
|
for (const p of externalPackages) {
|
||||||
if (p.match.test(id)) {
|
if (p.match.test(id)) {
|
||||||
|
|
Loading…
Reference in New Issue