react+mobx+antd按需加载 出现Support for the experimental syntax 'decorators-legacy' isn't currently enabled


baidu上面的说法大多是在 项目的package.json 中添加decorators-legacy

因为引入了antd的按需加载 所以只需要在config-overrides.js中添加addDecoratorsLegacy()

const { override, fixBabelImports,addDecoratorsLegacy } = require('customize-cra');
 
  module.exports = override(
    fixBabelImports('import', {
    libraryName: 'antd',
    libraryDirectory: 'es',
    style: 'css',
    }),addDecoratorsLegacy(),
);


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM