如何强制babel不要查看父目录.babelrc?
.babelrc文件:./a/.babelrc和./a/example/.babelrc.babel在./a/example路上奔跑../a/.babelrc 定义了一个插件"lodash"../a/example我试过设置./a/example/.babelrc为:
{
"stage": 0,
"plugins": []
}
Run Code Online (Sandbox Code Playgroud)
但是,babel在./a/example路径中运行仍然使用"lodash"插件.
$ pwd
/a/example
$ cat ./.babelrc
{
"stage": 0,
"plugins": []
}
$ cat ./../.babelrc
{
"stage": 0,
"plugins": [
"lodash"
]
}
$ babel ./src/
Error: ENOENT: no such file or directory, scandir '/a/node_modules/babel-plugin-lodash/node_modules/lodash'
[..]
$ babel --babelrc ./.babelrc ./src/
Error: ENOENT: no such file or directory, scandir '/a/node_modules/babel-plugin-lodash/node_modules/lodash'
[..]
Run Code Online (Sandbox Code Playgroud)
Gaj*_*jus 12
有一个名为的无证财产breakConfig.设置breakConfig为true禁用配置继承.
这种行为将在6.x中发生变化.在6.x中,Babel将在.babelrc它找到的第一个中断.extendsproperty将用于显式命名.babelrc要继承的其他文件.
| 归档时间: |
|
| 查看次数: |
2504 次 |
| 最近记录: |