Skip to content

Latest commit

 

History

History
46 lines (39 loc) · 866 Bytes

day_007.md

File metadata and controls

46 lines (39 loc) · 866 Bytes

day 7

antd: Ant Design of React

Ant Design of React 官网

安装

yarn add antd
// 安装 craco
yarn add @craco/craco
// 安装 craco craco-less
yarn add craco-less
//创建craco.config.js
//添加配置项到config
const CracoLessPlugin = require('craco-less');

module.exports = {
  plugins: [
    {
      plugin: CracoLessPlugin,
      options: {
        lessLoaderOptions: {
          lessOptions: {
            modifyVars: { '@primary-color': '#1DA57A' },
            javascriptEnabled: true,
          },
        },
      },
    },
  ],
};


//修改package.json
"scripts": {
-   "start": "react-scripts start",
-   "build": "react-scripts build",
-   "test": "react-scripts test",
+   "start": "craco start",
+   "build": "craco build",
+   "test": "craco test",
}

//运行yarn start 即可