babel-plugin-require-context-hook
babel-plugin-require-context-hook copied to clipboard
Upgrade to Babel 7
The dependencies are v6. Support to the latest major version https://babeljs.io/blog/2018/08/27/7.0.0
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']bypresets: ['@babel/preset-env']in my babel config - installed
babel-core@^7.0.0-bridge.0and@babel/corein my package.json
And it works!
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
any progress on this one?