[英]Which directory(s) does Babel look for plugins?
The obvious answer would be that Babel searches for plugins in node_modules
with a babel-plugin
prefix, but are there any other directories that it searches in? 显而易见的答案是,Babel会在带有
babel-plugin
前缀的node_modules
搜索babel-plugin
,但是它还在搜索其他目录吗? If not, is it possible to configure Babel to look through other directories? 如果不是,是否可以将Babel配置为浏览其他目录?
You can specify a relative or absolute path to plugins in your .babelrc
file (or however you pass settings to babel). 您可以在
.babelrc
文件中指定插件的相对或绝对路径(或将设置传递给babel)。
"plugins": ["./node_modules/asdf/plugin"]
See this explanation . 请参阅此说明 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.