babel-plugin-require-context-hook icon indicating copy to clipboard operation
babel-plugin-require-context-hook copied to clipboard

Upgrade to Babel 7

Open jfsiii opened this issue 7 years ago • 3 comments

The dependencies are v6. Support to the latest major version https://babeljs.io/blog/2018/08/27/7.0.0

jfsiii avatar Oct 30 '18 23:10 jfsiii

I found this issue because I was not able to make jest work with babel 7 and storybook

I thought I would be blocked until this issue was fixed but I was wrong, this plugin already works with babel 7 and my mistake was I was using a .babelrc config file while Jest doc explicitely says that I have to use a babel.config.js file in order to be compatible with babel 7 (https://jestjs.io/docs/en/getting-started.html#using-babel)

So I wrote a babel.config.js file:

module.exports = {
  <content of my .babelrc file>
}

...and deleted the .babelrc file

I also:

  • replaced presets: ['env'] by presets: ['@babel/preset-env'] in my babel config
  • installed babel-core@^7.0.0-bridge.0 and @babel/core in my package.json

And it works!

acailly avatar Nov 28 '18 09:11 acailly

Someone ported this to a macro that is compatible with babel 7. This allowed me to upgrade my Storybook to v4!

https://github.com/storybooks/require-context.macro

amaldare93 avatar Feb 25 '19 19:02 amaldare93

any progress on this one?

sibelius avatar May 06 '19 21:05 sibelius