Webpack loader for translating .po files (GNU gettext) into JSON. Uses po2json under the hood, supports mozilla/nunjucks, Jed, and other formats. Version 0.7.0 (latest, 2017). Sync and async usage; often paired with Jed for i18n. No updates since 2017, works with webpack v1 only. Not actively maintained; consider @lingui/webpack or i18n-webpack-plugin.
npm install po-loaderVerified import paths — ran on the pinned version, not inferred.
Webpack config to load .po files with po-loader and json-loader, then async import a .po file and use Jed.
Upgrade to webpack 1 or switch to a modern i18n webpack plugin like @lingui/webpack
Use po2json@1.0.0-beta-3 exactly in package.json
Always use json!po prefix in require or configure in webpack.config with json!po loader string
Use import(`${LOCALE_ROOT}/${locale}/LC_MESSAGES/messages.po`) with LOCALE_ROOT as a constant stringAdd po-loader and json-loader to webpack config: { test: /\.po$/, loader: 'json!po' }npm install po2json@>=1.0.0-beta-3 --save-dev or --save