我已经在我的next.js应用程序中安装了顺风,它在我的本地主机上工作,但是当我将它部署到vercel或者构建它并运行它时,它不使用顺风类,它看起来就像在部署时没有安装顺风。
这是我的包裹
{
"name": "portofilo",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build && next export",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"bootstrap": "^5.1.0",
"eslint": "7.32.0",
"eslint-config-next": "11.1.0",
"next": "11.1.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-icons": "^4.2.0",
"react-typed": "^1.2.0",
"react-vertical-timeline-component": "^3.3.3",
"styled-components": "^5.3.0",
"styled-normalize": "^8.0.7",
"postcss-import": "^14.0.2"
},
"devDependencies": {
"autoprefixer": "^10.3.1",
"postcss": "^8.3.6",
"postcss-import": "^14.0.2",
"tailwindcss": "^2.2.7"
}
}顺便说一下,我将devDependencies移动到依赖项,但仍然无法工作。
发布于 2021-08-22 19:51:07
我只是在我的顺风配置文件中添加了这一行代码,它起作用了!
启用: process.env.NODE_ENV === "production",
发布于 2021-08-21 13:40:29
确保您的清除在tailwind.config.js文件中配置正确
它应该是:
purge: [ "./src/pages/**/*.{js,ts,jsx,tsx}", "./src/components/**/*.{js,ts,jsx,tsx}", ],
https://stackoverflow.com/questions/68872504
复制相似问题