react+mobx+antd按需加載 出現Support for the experimental syntax 'decorators-legacy' isn't currently enable

baidu上面的說法大可能是在 項目的package.json 中添加decorators-legacycss

由於引入了antd的按需加載 因此只須要在config-overrides.js中添加addDecoratorsLegacy()json

const { override, fixBabelImports,addDecoratorsLegacy } = require('customize-cra');
 
  module.exports = override(
    fixBabelImports('import', {
    libraryName: 'antd',
    libraryDirectory: 'es',
    style: 'css',
    }),addDecoratorsLegacy(),
);
相關文章
相關標籤/搜索