import { defineConfig } from 'umi'; export default defineConfig({ nodeModulesTransform: { type: 'none', }, routes: [ { path: '/', component: '@/pages/index' }, ], proxy: { '/api': { target: 'http://localhost:3000', changeOrigin: true, pathRewrite: { '^/api': '' }, }, }, fastRefresh: {}, chainWebpack(conf) { // ....other config conf.module .rule('mjs$') .test(/\.mjs$/) .include .add(/node_modules/) .end() .type('javascript/auto'); }, });