diff --git a/src/app/app.ts b/src/app/app.ts index c8cf6f1a..573ec021 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -30,9 +30,10 @@ const languages: { [key: string]: string } = { 'zh-CN': '简体中文' } +const publicPath = process.env.NODE_ENV === 'production' ? '/dev/' : '/'; Promise.all([ - fetch('../locales/schema/en.json').then(r => r.json()), - fetch('../locales/app/en.json').then(r => r.json()) + fetch(publicPath + 'locales/schema/en.json').then(r => r.json()), + fetch(publicPath + 'locales/app/en.json').then(r => r.json()) ]).then(responses => { LOCALES.register('en', {...responses[0], ...responses[1]}) @@ -95,7 +96,7 @@ Promise.all([ `