【问题标题】:Why tailwind key is missing?为什么顺风键不见了?
【发布时间】:2022-01-24 15:58:25
【问题描述】:

我不明白为什么会出现这个问题

警告 - content 键丢失或为空。请填充内容密钥,因为 Tailwind 根据使用它们的文件按需生成实用程序。有关更多信息,请参阅文档:https://tailwindcss.com/docs/content-configuration

tailwind.config.js

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

【问题讨论】:

  • 请附上您的tailwind.config.js 文件。
  • module.exports = { content: [ "./src/**/*.{js,jsx,ts,tsx}", ], 主题: { extend: {}, }, 插件: [], }
  • html 文件在哪里?
  • 我不明白对不起
  • 这方面有没有成功?今天在同一个问题上运行。

标签: tailwind-css tailwind-in-js tailwind-ui


【解决方案1】:

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

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

【讨论】:

    【解决方案2】:

    尝试添加这个

    purge: {
        enabled: true,
        content: [
            './**/*.html'
        ]
      },
    content: ["./src/**/*.{html,jsx}"],
    

    【讨论】:

      【解决方案3】:

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

      【讨论】:

      • 正如目前所写,您的答案尚不清楚。请edit 添加其他详细信息,以帮助其他人了解这如何解决所提出的问题。你可以找到更多关于如何写好答案的信息in the help center
      猜你喜欢
      • 1970-01-01
      • 2015-02-21
      • 2011-08-26
      • 2022-07-29
      • 1970-01-01
      • 1970-01-01
      • 2021-10-04
      • 1970-01-01
      • 2021-04-17
      相关资源
      最近更新 更多