Skip to content

Babel plugin can't be used in a TS monorepo before building the code #1702

@1999

Description

@1999

Describe the bug
Our monorepo contains TS files. Babel plugin expects the required/imported files to exist when it is being used. However, we don't run the "build" command, therefore we don't have transpiled JS files.

The actual error message in our case looks like this:

     /Users/<username>/atlassian/afm/<path>/notification-component.tsx: Cannot find module '@atlaskit/tokens' from '/Users/<username>/atlassian/afm/<project>/node_modules/@compiled/babel-plugin/dist/utils'

To Reproduce
Steps to reproduce the behavior:

  1. TS Monorepo without built JS files
  2. Unit tests using "babel-jest"
  3. @compiled/babel-plugin in babel.config.json

Expected behavior
No error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions