Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trying to build Jest is throwing "Caching was left unconfigured."

Tags:

babeljs

jestjs

I have the following .babelrc.js in the root folder:

{
       "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"
}

but when it tries to run node ./packages/jest-cli/bin/jest.js I see:

Caching was left unconfigured. Babel's plugins, presets, and .babelrc.js files can be configured for various types of caching, using the first param of their handler functions:

What am I missing?

like image 832
Jackie Avatar asked Jun 20 '18 02:06

Jackie


1 Answers

Use new 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"
    ]
  }
}
like image 55
Goodmind Avatar answered Sep 22 '22 11:09

Goodmind