"scripts": {
  "dev": "next dev",
  "build": "next build",
  "start": "next start -p 80"
},

如果引入antd的样式,打包会报错!删除按需引入的antd样式

在page目录下,新建一个_app.js文件,_app.js文件为约定的全局目录

import App from 'next/app'

import 'antd/dist/antd.css'

export default App

这样配置一下,就可以打包成功了,然后再运行yarn start来运行服务器

相关文章:

  • 2022-12-23
  • 2023-03-04
  • 2021-12-18
  • 2021-07-18
  • 2021-11-17
  • 2021-06-10
  • 2021-09-19
  • 2019-05-18
猜你喜欢
  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
  • 2019-10-01
  • 2021-09-27
  • 2022-12-23
相关资源
相似解决方案