arackaf / customize-cra

Override webpack configurations for create-react-app 2.0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

addDecoratorsLegacy doesn't work for test

hyperknot opened this issue · comments

I'm using latest CRA 4.0.1 + latest customize-cra + rewired, the only option defined is addDecoratorsLegacy

yarn start and yarn build works perfectly.
yarn test does not, it terminates with an error of:

Support for the experimental syntax 'decorators-legacy' isn't currently enabled

I figured out, this is by design. Solution was to add babel.config.js with the following contents:

module.exports = {
  presets: ['react-app'],
  plugins: [['@babel/plugin-proposal-decorators', { legacy: true }]],
}

Nothing else was needed (no changes to config-overrides.js or to package.json).