vue-element-admin npm run build:prod 报错 “You may need an appropriate loader to handle this file type.”

5anewei6  于 3个月前  发布在  其他
关注(0)|答案(1)|浏览(43)

Bug report(问题描述)

Mac OSX 上,可以 run dev,但是执行 build:prod 时报错

ERROR  Failed to compile with 1 errors                                                                                                                                                             下午11:02:51

 error  in ./src/router/index.js

Module parse failed: Unexpected token (48:13)
You may need an appropriate loader to handle this file type.
|     path: '/redirect/:path(.*)',
|     component: function component() {
>       return import('@/views/redirect/index');
|     }
|   }]

 @ ./src/main.js 21:0-30 59:10-16
 @ multi ./src/main.js

 ERROR  Build failed with errors.
Steps to reproduce(问题复现步骤)
Screenshot or Gif(截图或动态图)
Other relevant information(格外信息)
  • Your OS: MacOS Catalina 10.15.5
  • Node.js version: v12.5.0
  • vue-element-admin version: 4.4.0
u4dcyp6a

u4dcyp6a1#

执行 npm install webpack 后,可以打包成功

相关问题