Babel忽略几个目录 [英] Babel ignore several directories
本文介绍了Babel忽略几个目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我目前正在用一个简单的命令运行Babel:
I'm currently running Babel with a simple command :
$ babel . --ignore node_modules --out-dir dist
但是我找不到办法忽略几个目录(node_modules,test),我尝试了很多东西,包括(在 .babelrc
):
But I can't find a way to ignore several directories (node_modules, test), I tried a lot of things, including (in .babelrc
):
"ignore": "node_modules"
"ignore": "/node_modules/"
"ignore": "node_modules/**"
"ignore": ["node_modules"]
根本不起作用(编译node_modules)。有没有一种简单的方法来实现这一点(使用Babel 6)?
Which doesn't work at all (node_modules are transpiled). Isn't there a simple way to achieve this (with Babel 6)?
推荐答案
你应该可以在cli
babel。 --ignore node_modules,test --out-dir dist
这篇关于Babel忽略几个目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文