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-08 08:33:23 -08:00
2016-02-08 02:18:10 +00:00
2016-02-06 19:06:41 -05:00
2016-02-11 11:13:57 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-10 22:40:44 -07:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-10 22:49:02 -07:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-10 22:42:50 -07:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-08 02:18:10 +00:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-06 19:06:41 -05:00
2016-02-10 22:42:50 -07:00
2016-02-10 22:40:44 -07:00
2015-10-29 17:51:24 +00:00