Skip to content
This repository has been 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

Open
tokenvolt opened this issue Jul 5, 2016 · 0 comments
Open

Comments

@tokenvolt
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant