我有以下的 .babelrc.js 在根文件夹中:
.babelrc.js
{ "plugins": [ "@babel/plugin-transform-flow-strip-types", "@babel/plugin-transform-modules-commonjs", "@babel/plugin-transform-async-to-generator", "@babel/plugin-transform-strict-mode", "@babel/plugin-transform-runtime" ], "cache": "true" }
但当它试图逃跑时 node ./packages/jest-cli/bin/jest.js 我懂了:
node ./packages/jest-cli/bin/jest.js
缓存未配置。Babel的插件、预置和.abelrc.js文件可以被配置 对于各种类型的缓存,使用它们的处理函数的第一个参数:
我错过了什么?
使用新 babel.config.js
babel.config.js
https://new.babeljs.io/docs/en/next/babelconfigjs.html
module.exports = function(api) { api.cache(true) return { plugins: [ "@babel/plugin-transform-flow-strip-types", "@babel/plugin-transform-modules-commonjs", "@babel/plugin-transform-async-to-generator", "@babel/plugin-transform-strict-mode", "@babel/plugin-transform-runtime" ] } }