Babel CLI非常慢 [英] Babel CLI is extremely slow
本文介绍了Babel CLI非常慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所以我遵循此处的安装方法,但是babel编译时间很长,甚至小文件:
So I follow the installation here, but babel takes very long time to compile, even small files:
app.js
let app = 1;
.babelrc
{ "presets": ["es2015"] }
package.json
"scripts": {
"build": "babel app.js -o dist/app.js"
},
"devDependencies": {
"babel-cli": "^6.4.5",
"babel-preset-es2015": "^6.3.13"
}
然后npm run build
大约需要30秒才能编译.
Then npm run build
will take ~30s to compile.
我正在使用npm@3.3.12
推荐答案
您可能也在编译node_modules
和bower_components
.
您可以尝试在项目.babelrc
中添加ignore
属性,如下所示:
You can try adding the ignore
property in your projects .babelrc
like so:
{
...
"ignore": /(node_modules|bower_components)/
...
}
希望这可以解决您的问题
Hope this solves your issue
这篇关于Babel CLI非常慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文