Skip to content
This repository has been archived by the owner on Nov 3, 2019. It is now read-only.

fix babel warnings, add required babel dependencies #323

Conversation

leonardodino
Copy link
Contributor

upgrading gatsby resulted in this module throwing a huge amount of babel warnings.
(probably one for each file)

this fixes that (:

  • added modules required by gen-mdx in gatsby-mdx/package.json
  • declared which version of corejs to use in the transformation
  • the pre-commit hook reformated a line contaning a regexp

related issue in gatsby core
related PR in gatsby core

@@ -146,7 +147,10 @@ module.exports = async function genMDX({
results.scopeIdentifiers = identifiers;
// TODO: be more sophisticated about these replacements
results.body = result.code
.replace(/export\s*{\s*MDXContent\s+as\s+default\s*};?/, "return MDXContent;")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can amend it, if wanted. but was auto-formatted anyways. 🤷‍♂️

@alexandernanberg
Copy link
Collaborator

I wonder if we should use babel-preset-gatsby here instead 🤔

@ChristopherBiscardi
Copy link
Owner

Thanks for the PR @leonardodino

It'll take a second to merge since we've stopped development on master while we prepare the 0.5 release to coincide with mdx-js 1.0

babel-preset-gatsby might be the right move here. The loader passes through to the user's babel-loader config in the loader chain while the "generated" code path only has this code path to return usable code.

@ChristopherBiscardi
Copy link
Owner

merged in 78b5893

Thanks @leonardodino !

@leonardodino leonardodino deleted the fix-babel-env-preset branch April 1, 2019 21:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants