问题描述
在我的 package.json 文件中,我在下面的脚本下有一个命令:
Inside my package.json file I have a command under scripts below:
"scripts": {
"build-css": "tailwindcss build src/styles.css -o public/styles.css"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"autoprefixer": "^10.3.0",
"tailwindcss": "^2.2.4"
}
}
这是我的文件结构
当我尝试使用构建命令并运行 npm run build:css
时出现此错误
When I try to use my build command and run npm run build:css
I get this error
[弃用] 不带 -i 运行 tailwindcss,请提供输入文件.
如果我已经在脚本下指定了路径,我不明白我做错了什么,这不意味着我已经包含了输入文件吗?
I don't understand what I'm doing wrong if I already specified the path under scripts doesn't that mean I already included the input file?
推荐答案
在构建 CSS 时,您必须包含 -i
选项和该文件的路径 使用自定义 CSS 文件.例如,将 package.json 中的 build-css
脚本更改为以下内容.
You have to include the -i
option and the path to that file when building your CSS using a custom CSS file. For example, change the build-css
script in your package.json to be the following.
"scripts": {
"build-css": "tailwindcss build -i src/styles.css -o public/styles.css"
},
这篇关于构建时出现构建 Tailwind 弃用错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!