smrq / babel-plugin-require-context-hook

Babel plugin to replicate Webpack require.context
47 stars 14 forks source link

Upgrade to Babel 7 #5

Open jfsiii opened 6 years ago

jfsiii commented 6 years ago

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

acailly commented 6 years ago

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:

And it works!

amaldare93 commented 5 years ago

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

sibelius commented 5 years ago

any progress on this one?