翻訳ファイルをランタイムで読み込み
This commit is contained in:
parent
ec4d5857d8
commit
84b488a912
6 changed files with 46 additions and 33 deletions
|
@ -33,9 +33,7 @@ const postcss = {
|
|||
},
|
||||
};
|
||||
|
||||
module.exports = Object.keys(isProduction ? locales : {
|
||||
'ja-JP': locales['ja-JP']
|
||||
}).map(lang => ({
|
||||
module.exports = {
|
||||
entry: {
|
||||
app: './src/client/init.ts',
|
||||
sw: './src/client/sw/sw.ts'
|
||||
|
@ -133,9 +131,7 @@ module.exports = Object.keys(isProduction ? locales : {
|
|||
new webpack.ProgressPlugin({}),
|
||||
new webpack.DefinePlugin({
|
||||
_VERSION_: JSON.stringify(meta.version),
|
||||
_LANG_: JSON.stringify(lang),
|
||||
_LANGS_: JSON.stringify(Object.entries(locales).map(([k, v]: [string, any]) => [k, v._lang_])),
|
||||
_LOCALE_: JSON.stringify(locales[lang]),
|
||||
_ENV_: JSON.stringify(process.env.NODE_ENV),
|
||||
_DEV_: process.env.NODE_ENV !== 'production',
|
||||
_PERF_PREFIX_: JSON.stringify('Misskey:'),
|
||||
|
@ -153,7 +149,7 @@ module.exports = Object.keys(isProduction ? locales : {
|
|||
],
|
||||
output: {
|
||||
path: __dirname + '/built/client/assets',
|
||||
filename: `[name].${meta.version}.${lang}.js`,
|
||||
filename: `[name].${meta.version}.js`,
|
||||
publicPath: `/assets/`
|
||||
},
|
||||
resolve: {
|
||||
|
@ -173,4 +169,4 @@ module.exports = Object.keys(isProduction ? locales : {
|
|||
},
|
||||
devtool: false, //'source-map',
|
||||
mode: isProduction ? 'production' : 'development'
|
||||
}));
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue