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

fix: BABEL_ENV should consider using production #3655

Merged
merged 1 commit into from
Oct 17, 2022

Conversation

jinliming2
Copy link
Contributor

Changes

BABEL_ENV should consider using production

Checklist

  • Included code example that can be used to test this change
  • Updated TS types
  • Added TS types tests
  • Added unit / integration tests
  • Updated documentation
  • Ensured that CI passes

Copy link
Member

@tomekzaw tomekzaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

Starting from 3.0.0-rc.3, Reanimated Babel plugin adds sourcemaps to worklets. In my case, this increases bundle size on web to 225 kB (compared to 27.6 kB without sourcemaps).

In #3650 I've proposed using process.env.NODE_ENV === 'production' to detect production build on web and it works for me (checked on Next.js + Reanimated example). However, with this PR, the bundle still contains sourcemaps. In my case, production.env.BABEL_ENV is undefined.

Could you please describe which case is resolved by this PR?

@jinliming2
Copy link
Contributor Author

@tomekzaw I'm using Re.Pack to build my RN app, which uses Webpack under the hood. In this case, BABEL_ENV was default set to 'production' when build in release mode.

@tomekzaw
Copy link
Member

tomekzaw commented Oct 7, 2022

Great, thanks for information! So I think we can merge this.

@tomekzaw tomekzaw requested a review from piaskowyk October 7, 2022 11:44
Copy link
Member

@piaskowyk piaskowyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@piaskowyk piaskowyk merged commit 58a7a5b into software-mansion:main Oct 17, 2022
@jinliming2 jinliming2 deleted the fix-babel-env branch October 20, 2022 18:49
fluiddot pushed a commit to wordpress-mobile/react-native-reanimated that referenced this pull request Jun 5, 2023
## Changes

BABEL_ENV should consider using production
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants