import { defineConfig } from 'umi'; export default defineConfig({ favicon: './favicon.ico', routes: [ { exact: false, path: '/', component: '@/layouts/index', routes: [ { exact: true, path: '/', component: '@/pages/Home' }, ], }, ], antd: { dark: false, }, chainWebpack(memo, { env, webpack, createCSSRule }) { // 设置 alias memo.resolve.alias.set('foo', '/tmp/a/b/foo'); //memo.resolve.extensions.add('.tsx') memo.merge({ resolve: { extensions: [".tsx", ".ts"] } }) } });