const { override, fixBabelImports, addLessLoader, overrideDevServer } = require('customize-cra'); const addProxy = () => (configFunction) => { configFunction.proxy = { '/api/': { target: 'http://localhost:3001', changeOrigin: true, pathRewrite: { '^/api': '/api' }, }, }; return configFunction; } module.exports = { webpack: override( fixBabelImports('import', { libraryName: 'antd', libraryDirectory: 'es', style: true, }), addLessLoader({ javascriptEnabled: true, modifyVars: { '@primary-color': '#25b864' }, }), ), devServer: overrideDevServer( addProxy() ) };