Skip to content

.babelrc extends issue #172

Closed
Closed

Description

If I have a .babelrc file in the root of my project with an extends clause, the path doesn't resolve relative to the .babelrc file. Instead, it seems like it's relative to the .storybook/config.js file.

For example, consider a directory structure like this:

.storybook/
  config.js
node_modules/
  another_module/
    .babelrc
.babelrc

And say my .babelrc at the root level has this code:

{ "extends": "./node_modules/another_module/.babelrc" }

This does not work. But if I change the code to (go up a directory first):

{ "extends": "../node_modules/another_module/.babelrc" }

it does work.

I'm not entirely sure what the issue is, but it seems like it would be more intuitive to be able to use paths relative to the root when using the root .babelrc file.

Of course a solution could be to copy the contents of my root .babelrc to .storybook/ and make paths relative to that directory (thanks to #149), but then I would need to maintain two .babelrc files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions