Git Product home page Git Product logo

Comments (10)

akkie avatar akkie commented on September 21, 2024 1
presets: [
  'lingui-react',
  ['babel-preset-env', {

This works for me. But You're right. This should be easier.

from js-lingui.

tricoder42 avatar tricoder42 commented on September 21, 2024

Is lingui-react the last preset in your .babelrc?

from js-lingui.

akkie avatar akkie commented on September 21, 2024

It's currently the only plugin. The other plugins will be added by neutrino.

from js-lingui.

tricoder42 avatar tricoder42 commented on September 21, 2024

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.

akkie avatar akkie commented on September 21, 2024

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.

tricoder42 avatar tricoder42 commented on September 21, 2024

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.

tricoder42 avatar tricoder42 commented on September 21, 2024

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.

tricoder42 avatar tricoder42 commented on September 21, 2024

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.

tricoder42 avatar tricoder42 commented on September 21, 2024

Closing for now.

I'm gonna add info about integrations to docs.

from js-lingui.

tricoder42 avatar tricoder42 commented on September 21, 2024

Added section about integrations https://lingui.gitbooks.io/js/guides/integrations.html

from js-lingui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.