Loading

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(),
);
posted @ 2019-03-01 00:07  害羞的蘑菇  阅读(2611)  评论(1编辑  收藏  举报