-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update webpack to version 5, changed configuration from previous comm…
…it, compile correctly with json-loader to correct
- Loading branch information
Showing
5 changed files
with
373 additions
and
454 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
export const DEFAULT_LOCALE = 'en'; | ||
export const LOCALES = ['en']; | ||
const context = require.context('./', false, /\.json$/); | ||
|
||
const locales = LOCALES.reduce((acc, locale) => { | ||
acc[locale] = require(`./${locale}.json`); | ||
return acc; | ||
}, {}); | ||
const locales = {}; | ||
|
||
context.keys().forEach((key) => { | ||
const locale = key.replace('./', '').replace('.json', ''); | ||
locales[locale] = context(key); | ||
}); | ||
|
||
export default locales; |
Oops, something went wrong.