Skip to content

Commit

Permalink
Update webpack to version 5, changed configuration from previous comm…
Browse files Browse the repository at this point in the history
…it, compile correctly with json-loader to correct
  • Loading branch information
mikozet committed Jul 4, 2024
1 parent 8279cb7 commit aa194e7
Show file tree
Hide file tree
Showing 5 changed files with 373 additions and 454 deletions.
3 changes: 2 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-nullish-coalescing-operator"
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-syntax-dynamic-import"
]
}
13 changes: 7 additions & 6 deletions locales/index.js
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;
Loading

0 comments on commit aa194e7

Please sign in to comment.