我想在Ember应用程序中将babel选项配置为忽略data-stubs
文件夹,或者将compact
设置为false,以便在构建过程中使以下错误消失:
[Babel: my-app > applyPatches][BABEL]
Note: The code generator has deoptimised the styling of dev/my-app/tests/data-stubs/foo.js
as it exceeds the max of 500KB.
[StackOverflow上的可接受答案表示使用.babelrc
配置{"compact": false}
文件,但不适用于ember-cli构建。参考答案:BABEL Note: The code generator has deoptimised the styling of "app.js" as it exceeds the max of "100KB in Meteor
我在ember应用程序的根文件夹中制作了一个.babelrc
文件,并尝试了许多不同的配置:
{
"ignore": ["**/data-stubs/*.js", "tests/data-stubs/*", "*tests/data-stubs/*"], //do not translate our stub files
"compact": false,
"env": {
"development": {
"compact": false
}
}
}
没有任何作用,并且总是导致The code generator has deoptimised the styling
错误消息。我还将.babelrc
文件放入与上述相同设置的data-stubs
文件夹中,该文件也无效。
这是预期的。灰烬使用ember-cli-babel
在文档中声明: