Adam Miskiewicz c1960dbe02 Make Babel resolve plugins relative to where they were specified.
Given the following `.babelrc`:

```
{
  "plugins": ["./myPluginDir/somePlugin.js"]
}
```

Babel should resolve that plugin relative to the directory that contains the `.babelrc` file.

Currently, Babel is resolving the plugin relative to the current `process.cwd()`, as you can see in this test case: https://github.com/skevy/babel-plugin-resolution-test-case

This is occurring because the "fake" `Module` that we're creating in the `resolve` helper doesn't have an `id` and `filename`. Therefore, Node builds an array of paths that contains a number of node_module paths as well as `.`, and doesn't contain the path in which we'd actually like to look up the plugin. `.` of course resolves to the current `process.cwd()`, and thus makes the Babel plugin resolution mechanism quite fragile. The relevant code in Node.JS can be found here (tagged at the v5.4.1 release): ff99203724/lib/module.js (L236-L242).

This PR adds `id` and `filename` to that fake `Module` in order to resolve this issue.
2016-02-11 11:13:57 -05:00
2016-02-04 11:07:04 -05:00
2015-11-09 17:58:36 -08:00
2016-02-04 11:07:03 -05:00
2015-07-16 15:46:31 +01:00
2015-11-09 04:03:59 -08:00
2014-12-16 22:17:35 -08:00
2016-01-04 22:59:12 -05:00
2016-02-08 19:59:34 -05:00
2015-11-11 23:24:39 -08:00
2015-12-30 13:42:32 -05:00
2016-02-08 02:18:10 +00:00

babel

The compiler for writing next generation JavaScript.

Travis Status CircleCI Status Coverage Status

Looking for support?

For questions and support please visit the discussion forum, Slack community, or StackOverflow.

Want to report a bug or request a feature?

Bugs and feature requests should be posted at phabricator.babeljs.io.

Want to report an issue with babeljs.io?

For documentation and website issues please visit the babel.github.io repo.

Description
No description provided
Readme 79 MiB
Languages
JavaScript 99.5%
Makefile 0.3%
HTML 0.1%