Webpack loader for message catalogs
See original GitHub issueMy goal is to load my messages without manually compiling (lingui compile
) them during development. I don’t have a problem manually compiling them for a production build but having to do it manually after every change to the files is cumbersome.
I used create-react-app and ejected it to be able to add the lingui-react babel preset, which means I’m using webpack. I couldn’t find a webpack loader to watch and compile the catalogs.
I’m also a little confused about the lingui-i18n/dev package. I assumed I could use it to load my messages.json files and create catalogs from it on the fly, but from the tutorial it seems that I have to load the compiled .js catalogs anyway.
Is there an easy way to achieve what I want?
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
API Reference - Webpack Loader (@lingui/loader)
@lingui/loader is a webpack loader, which compiles messages on the fly: ... Simply prepend @lingui/loader: in front of path to message catalog you...
Read more >lingui/loader
@lingui/loader. webpack loader for compiling message catalog on the fly. @lingui/loader is part of LinguiJS. See the documentation for all ...
Read more >Webpack-loader | npm.io
Plugin loader for Sanity. Resolves parts based on a declared Sanity manifest and provides infrastructure for loading the required plugins.
Read more >lingui/js-lingui - Gitter
import(/* webpackMode: "lazy", webpackChunkName: "i18n-[index]" */ @lingui/loader!./locales/${lang}/messages.json ). I get back a catalog with empty ...
Read more >lingui/loader - npm Package Health Analysis
webpack loader for lingui message catalogs For more information about how to use this package see README. Latest version published 19 days ago....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @pybuche, if you use
@lingui/loader
, you don’t have to runlingui compile
manually. Loader actually creates production ready compiled catalogs.These two import statements are identical:
Just release lingui-loader@0.1.0. This is first release, please consider it experimental. I tried it with webpack example and it works fine. I’m releasing it early to get feedback as soon as possible.
Quickstart
or using dynamic import
See webpack example.
I’ll add more docs tomorrow.