英文:
error with linking source file path using tailwindcss
问题
这是我收到的错误消息:
警告 - 在您的源文件中未检测到任何实用类。如果这不是您预期的情况,请仔细检查您的Tailwind CSS配置中的“content”选项。
我无法弄清楚为什么会出现这个与Tailwind有关的错误。这里有一个非常好的解释这个错误的解释。
我检查了所有的路径,但找不到我的错误。我认为可能有一个路径错误。
我的代码可以在这里找到。
tailwind.config.js链接到“./index.html”,该文件位于根目录中。
英文:
This is the error message I get:
warn - No utility classes were detected in your source files. If this is unexpected, double-check the `content` option in your Tailwind CSS configuration.
I can't figure out why I get this error with tailwind. Here is a very good explanation what the error is about.
I checked all my paths and can't find my mistake. I assume that one path is wrong.
My code can be found here.
tailwind.config.js links to "./index.html", which is in the root folder.
答案1
得分: 1
以下是您要翻译的内容:
"似乎您可能正在从tailwindcss
文件夹中运行Tailwind CSS CLI,就像这样:
cd tailwindcss
npx tailwindcss -i input.css -o output.css
在这种情况下,./index.html
意味着文件 tailwindcss/index.html
,但该文件不存在,因此CLI会发出警告。
如果您想继续从tailwindcss
文件夹内部启动tailwindcss
命令,可以考虑更改路径为 ../index.html
。
或者,您可以从项目的根目录运行Tailwind CSS CLI:
npx tailwindcss -c tailwindcss/tailwind.config.js -i tailwindcss/input.css -o tailwindcss/output.css
```"
<details>
<summary>英文:</summary>
It seems like you may be running Tailwind CSS CLI from the `tailwindcss` folder, as in:
```sh
cd tailwindcss
npx tailwindcss -i input.css -o output.css
In which case, ./index.html
would mean the file tailwindcss/index.html
which does not exist and thus the warning from the CLI.
You could consider changing the path to ../index.html
if you would like to continue to initiate the tailwindcss
command from within the tailwindcss
folder.
Alternatively, you could run Tailwind CSS CLI from the root of the project:
npx tailwindcss -c tailwindcss/tailwind.config.js -i tailwindcss/input.css -o tailwindcss/output.css
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论