Skip to content

Not compatible with babel-plugin-transform-imports #136

Description

@joncursi

I want to use this module along with babel-plugin-transform-imports so that I can map both internal and external import paths. However, this plugin causes babel-plugin-transform-imports to stop functioning.

E.g.:

    [
      'babel-plugin-root-import',
      {
        rootPathPrefix: '~',
        rootPathSuffix: './src',
      },
    ],
    [
      'babel-plugin-transform-imports',
      {
        '~/components': {
          preventFullImport: true,
          transform: '~/components/${member}',
        },
        '@material-ui/core': {
          preventFullImport: true,
          transform: '@material-ui/core/${member}',
        },
        lodash: {
          preventFullImport: true,
          transform: 'lodash/${member}',
        },
    ],

In the built files, ~ is appropriately mapped for internal modules, however it is as if babel-plugin-transform-imports never ran (built files are still using named imports).

Activity

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

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