Replies: 1 comment 2 replies
-
Check reporting errors and make sure the files are esm format. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hi, Comunity who can help? I am using files with js extension, not a jsx, and out of the box umi 4 throws an error during the build process.
Parse file (all fies with js end)*ctions.js exports error, please check this file esm format.
my config.js file
import { defineConfig } from "@umijs/max";
import {routes} from './routes';
export default defineConfig({
plugins: ['@umijs/plugins/dist/antd', '@umijs/plugins/dist/locale'],
crossorigin: true,
// alias
alias: {
'@': './src',
'@@': './src/.umi',
'worker': './public/worker',
'assets': './public/assets',
'tests': './tests',
},
esbuildMinifyIIFE: true,
codeSplitting: {
jsStrategy: 'granularChunks'
},
routes,
npmClient: 'yarn',
fastRefresh: true,
mfsu: true,
two: {},
initialState: {},
module: {},
layout:{
title:'UmiJS',
locale:true,
},
antd : {
},
}
});
package.json
"scripts": {
"dev": "max dev",
"build": "max build",
"postinstall": "max setup",
"setup": "max setup",
"start": "npm run dev"
},
"dependencies": {
"babel-plugin-formatjs": "^10.5.10",
"classnames": "^2.3.2",
"react-icons": "^4.12.0",
"react-responsive": "^9.0.2"
},
"devDependencies": {
"@ant-design/icons": "^5.2.6",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@umijs/max": "^4.0.88",
"antd": "^5.11.1",
"eslint-plugin-react-hooks": "^4.6.0",
"mockjs": "^1.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rimraf": "^5.0.5"
},
"lint-staged": {
"*.{js,jsx,css,less}": [
"max lint --fix",
"git add"
]
}
Beta Was this translation helpful? Give feedback.
All reactions