Comments (10)
presets: [
'lingui-react',
['babel-preset-env', {
This works for me. But You're right. This should be easier.
from js-lingui.
Is lingui-react
the last preset in your .babelrc
?
from js-lingui.
It's currently the only plugin. The other plugins will be added by neutrino.
from js-lingui.
Could you please give me more info how you configure neutrino? Where do you add lingui-preset
?
I'm thinking about creating neutrino-preset-lingui
and adding required presets.
from js-lingui.
This is for the 0.x version of lingui. But the config is mostly the same for the project I'm currently working on.
https://github.com/setusoft/silhouette-play-react-seed/blob/master/app-ui/.neutrinorc.js
https://github.com/setusoft/silhouette-play-react-seed/blob/master/app-ui/.babelrc
from js-lingui.
What if you change neutrino-preset-react
config:
const path = require('path');
module.exports = {
use: [
['neutrino-preset-react', {
babel: {
presets: [
['babel-preset-env', {
targets: {
browsers: [
'last 1 Chrome versions',
'last 1 Firefox versions'
]
}
}],
'lingui-react'
]
}
}],
'neutrino-webpack.js',
'neutrino-sass.js',
...
]
}
instead of adding lingui-react
to .babelrc
?
from js-lingui.
Another option might be using lingui-transforms-js
and lingui-transform-react
plugins directly. Plugins run before presets, so that would work too. But I consider both options as a workaround. This should be easier.
from js-lingui.
That's interesting. Presets should be in reverse order (first preset at the bottom). So I would expect, that you need to put lingui-react
below env
.
I need to figure out how to deal with frameworks like create-react-app or neutrino.
from js-lingui.
Closing for now.
I'm gonna add info about integrations to docs.
from js-lingui.
Added section about integrations https://lingui.gitbooks.io/js/guides/integrations.html
from js-lingui.
Related Issues (20)
- [Idea] Use comments to define message placeholder names
- LinguiJS & Next.js standalone build not working HOT 3
- Monorepo: Per-package Lingui config requires `locales` key HOT 4
- Unable to integrate with the latest vite-react-swc template. HOT 6
- Update @lingui/cli to use glob version > 9 HOT 1
- NextJS 14.2.5 and Lingui 4.11.x issues following example app as outline HOT 1
- Lingui extract ignores babel config HOT 2
- Internal Server Error running nextjs-swc example with nodeLinker: pnp in .yarnrc.yml HOT 5
- Duplicate endlines are removed when using @lingui/macro HOT 2
- Allow comments from translators HOT 2
- Allow missing translations to be compiled/interpolated on production HOT 8
- children's types is not preserved when `<Trans>` is used
- High-Severity Regular Expression Denial of Service (ReDoS) Vulnerability in micromatch Dependency of @lingui/cli HOT 1
- Language family fallback HOT 3
- Trans from @lingui/react shall fallback to its message if there is no translation HOT 2
- Generate PO files only for components that contain some localized code HOT 2
- Place PO file relatively to the component file HOT 2
- Duplicate message entry if the same string is used in a macro msg`String` and in a React i18n._("String") HOT 1
- Unexpectedly skipped parsing of unicode values inside a string HOT 5
- Extract named parameters for some complex identifiers in t-macro HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-lingui.