自从NextJS 13出现问题以来,我已经使用相同的步骤安装了Tailwind很多次。
这是我的package.json文件为了复制,我使用了npx create-next-app@latest
并按照tailwind文档安装了nextjs。
这是我的json文件
{
"name": "fullstack",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"eslint": "8.37.0",
"eslint-config-next": "13.2.4",
"next": "13.2.4",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"autoprefixer": "^10.4.14",
"postcss": "^8.4.21",
"tailwindcss": "^3.3.0"
}
}
module.exports = {
content: [
"./app/**/*.{js,ts,jsx,tsx}",
"./pages/**/*.{js,ts,jsx,tsx}",
"./components/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
} ```
This is my tailwind config file
1条答案
按热度按时间1qczuiv01#
尝试在您的终端中运行此命令:
更新您的
tailwind.config.js
如下:更新
global.css
文件如下:最后,确保global.css正确导入到
pages/_app.js
文件中。