umijs/father 打包失败

运行打包命令 father-build

xxx.tsx

import styles from './index.less'
......
<div className={styles.header}>111</div>

.fatherrc.ts

export default {
  esm: 'babel',
};

tsconfig.json

{
  "compilerOptions": {
    "target": "esnext",
    "module": "esnext",
    "moduleResolution": "node",
    "jsx": "react",
    "esModuleInterop": true,
    "types": ["jest", "node"],
    "strict": true,
    "skipLibCheck": true,
    "declaration": true,
    "baseUrl": ".",
    "paths": {
      "@/*": ["src/*"],
      "@tmp/*": ["src/pages/.umi/*"]
    },
  },
  "exclude": ["node_modules", "build", "dist", "scripts", "src/.umi/*", "webpack", "jest"]
}

打包时报错
image.png

请问下这种问题怎么解决,是怎么引起的

阅读 1.6k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题