Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(babel-preset-gatsby): allow setting importSource on preset-react #29260

Merged
merged 5 commits into from
Feb 25, 2021

Commits on Jan 28, 2021

  1. feat(babel-preset-gatsby): allow passing importSource to preset-react

    With React 17's new JSX transform feature, it is possible to pass a custom JSX factory besides React's default one. This is useful when working with libraries like Emotion 11: https://emotion.sh/docs/css-prop#babel-preset.
    
    In order to support this feature in `babel-preset-gatsby`, this PR adds an option called `reactImportSource` that is passed down to the underlying `@babel/preset-react` preset option `importSource`.
    
    Users of `babel-preset-gatsby` can then use this like so:
    
    ```json
    {
      "presets": [
        [
          "babel-preset-gatsby",
          { "reactRuntime": "automatic", "reactImportSource": "@emotion/react" }
        ]
      ]
    }
    ```
    disintegrator committed Jan 28, 2021
    Configuration menu
    Copy the full SHA
    ac6de4f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    70938cd View commit details
    Browse the repository at this point in the history

Commits on Feb 25, 2021

  1. Configuration menu
    Copy the full SHA
    6007072 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'master' into patch-1

    Laurie committed Feb 25, 2021
    Configuration menu
    Copy the full SHA
    f9ad8c9 View commit details
    Browse the repository at this point in the history
  3. clean up tests, change syntax

    Laurie committed Feb 25, 2021
    Configuration menu
    Copy the full SHA
    80af79d View commit details
    Browse the repository at this point in the history