Skip to content
This repository was archived by the owner on Apr 9, 2020. It is now read-only.
This repository was archived by the owner on Apr 9, 2020. It is now read-only.

Local path as an argument to "transform" does not resolve the path. #100

@tokenvolt

Description

@tokenvolt

I have a .babelrc:

{
  "presets": ["es2015", "react"],
  "env": {
    "development": {
      "plugins": [
        // must be an array with options object as second item
        ["react-transform", {
          // must be an array of objects
          "transforms": [{
            // can be an NPM module name or a local path
            "transform": "./babel-plugins/react-transform-my",
            "imports": ["react"],
            "locals": ["module"]
          }]
          // by default we only look for `React.createClass` (and ES6 classes)
          // but you can tell the plugin to look for different component factories:
          // factoryMethods: ["React.createClass", "createClass"]
        }]
      ]
    }
  }
}

And in the same directory

babel-plugins/
└── react-transform-my
    └── index.js

When running the server I'm getting
Module not found: Error: Cannot resolve 'file' or 'directory' ./babel-plugins/react-transform-my

If I provide the full path to the directory it is resolved correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions