-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Disable loading custom .babelrc #2758
Comments
If I create But I don't want override storybook's config. I want only disable loading config from root. |
Rename .babelrc to build.babelrc.json to manually load when building @ui, and manually loading in webpack dev @frontend. Required until storybookjs/storybook#2758
You may want to replace our instance of
|
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 60 days. Thanks! |
This would be a nice feature. I require a
|
I'm trying to get started with Storybook in a monorepo and this is an issue for me too. As long as a root .babelrc exists, it seems impossible to use the default included Babel config. There really needs to be an option to choose between default or lookup. As a bonus, you could then rely on babel-loader's default lookup behaviour (in Babel 6: use the closest config relative to the module) instead of looking only and specifically in the root dir.
|
@noinkling #4077 should fix the issue: after releasing it, our default config will be merged with the one from your I'm also going to add a way to disable loading app's babel config without replicating Storybook default by providing a
It will work with Babel 7 only UPD: #4084 |
@Hypnosphi, can we consider this as done? Overriding babel configuration is already could be achieved with presets (although there is no documentation yet) |
Let's close it once we document it |
Any chance the documentation could be added? I'm also running into this and even after reading the merged pull requests for presets I'm not quite sure what I'm expected to do. Edit: Figured I'd browse the existing documentation. Might've been good to start with, but we all know how programmers think. https://storybook.js.org/configurations/custom-babel-config/ |
I've added a How do I go about solving this...? See: https://github.com/South-Paw/react-vector-maps/tree/dev |
* Note: Storybook is broken - it seems to load the root `.babelrc` and ignores the `.storybook/babel.config.js` (storybookjs/storybook#2758 (comment))
@South-Paw it was only an idea, the corresponding PR wasn't merged I hope that @igor-dv can tell you how to do it with presets |
I ended up fixing it by creating a separate |
Automention: Hey @ndelangen @shilman, you've been tagged! Can you give a hand here? |
I'm planning to fix this one for 6.x: But then we'll have to really figure out what we want to do for 7.0 A lot of them is because in the past (and still to some degree) storybook mixes the babel config for the preview and manager. @shilman Perhaps we need some "babel config in 7.0" milestone, and discuss options? |
Yee-haw!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.4.0-alpha.33 containing PR #15928 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
@shilman for users not familiar with the source code, could you give a little more info about ignoring a root |
@florianmartens did you already read the migration instructions? https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#babel-mode-v7 |
Hi, I have just overload the loading function from storybook to prevent the default babel configuration from storybook and ignoring any local custom place this in front of main.js const l = require('@storybook/core-common/dist/cjs/utils/load-custom-babel-config');
// drop current implementation
delete l['loadCustomBabelConfig'];
// set new just return default config
l.loadCustomBabelConfig = async function (configDir, getDefaultConfig) {
return getDefaultConfig();
}; then you can adjust plugins and preset in exports like: babel: async (options) => {
options.presets.push("next/babel");
options.plugins.push("module/plugin");
return options;
}, |
I use babel@7. But storybook use babel@6.
If I rename
.babelrc
all works correctly.But
babel-loader@8
wants.babelrc
file when load module through alias and I can't rename config file.Can I disable loading custom .babelrc?
The text was updated successfully, but these errors were encountered: