1

I don't understand why I have this issue

warn - The content key is missing or empty. Please populate the content key as Tailwind generates utilities on-demand based on the files that use them. For more information see the documentation: https://tailwindcss.com/docs/content-configuration

tailwind.config.js

module.exports = {
  content: [
    "./src/**/*.{js,jsx,ts,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}
4

3 回答 3

1

尝试添加这个

purge: {
    enabled: true,
    content: [
        './**/*.html'
    ]
  },
content: ["./src/**/*.{html,jsx}"],
于 2022-01-19T02:51:16.433 回答
1

我发现像下面这样更新 js -> jsx 带来了成功。

module.exports = {
  content: ["./src/**/*.{html,jsx}"],
  theme: {
    extend: {},
  },
  plugins: [],
}

于 2022-01-18T19:26:16.783 回答
-1

您需要将您的 html 链接到内容。现在,删除你在那里的所有内容并尝试仅链接 html 文件。稍后,请随意将其他文件放在那里。

于 2022-01-16T15:58:21.540 回答