Skip to content

@babel/register (by default) cannot apply .babelrc to files located on upper directories than cwd ย #7701

@shinout

Description

@shinout

This is a bug report. Occured on Babel7 (beta.44).

I've created a reproduction environment here(github). Please see there for detail.

Problem

@babel/register by default cannot apply .babelrc to files located on upper directories than current working directory.

Similar situations will be occurred when using Yarn Workspaces .

babel-register first creates default options (named transformOpts here) which contains ignore and only fields based on the current working directory.

After that, babel-core filters files upper than cwd by programmaticChain here before loading .babelrc.

Workaround

To avoid this behavior, passing babelrc-compatible options to @babel/register works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    outdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions