您可能需要适当的加载程序来处理此文件类型,目前没有配置加载程序来为 TailwindCss 处理此文件
我是第一次使用 tailwindcss,使用的是我在网上找到的教程。到目前为止,npm 安装了 tailwindcss、postcss、postcss-loader、autoprefixer。从 Tailwind 文档中,我需要 tailwind.config.js 和 postcss.config.js。
tailwind.config.js
module.exports = {
content: ["./client/*.{html,js}", "./client/**/*.{html,js}"],
theme: {
extend: {},
container: {
center: true,
},
},
};
postcss.config.js:
const tailwind = require("tailwindcss");
module.exports = {
plugins: [tailwind("./tailwind.config.js"), require("autoprefixer")],
};
我什至有一个 tailwind 的构建脚本:
"build:css": "postcss public/tailwind.css -i public/style.css",
在我的 tailwind.css 文件中,我添加了 Tailwind 指令:
@tailwind base;
@tailwind components;
@tailwind utilities;
我的 webpack 中需要什么样的加载器?此外,我在终端的问题选项卡下得到了这个:
在我的浏览器终端上,我在 console.log 中看到以下内容:
有关如何解决此问题并开始设计我的应用程序的任何提示吗?
I'm using tailwindcss for the first time, using tutorials I found online. So far npm installed tailwindcss, postcss, postcss-loader, autoprefixer. From Tailwind docs, I needed a tailwind.config.js and postcss.config.js.
tailwind.config.js
module.exports = {
content: ["./client/*.{html,js}", "./client/**/*.{html,js}"],
theme: {
extend: {},
container: {
center: true,
},
},
};
postcss.config.js:
const tailwind = require("tailwindcss");
module.exports = {
plugins: [tailwind("./tailwind.config.js"), require("autoprefixer")],
};
I even have a build script for tailwind :
"build:css": "postcss public/tailwind.css -i public/style.css",
In my tailwind.css file I added the Tailwind directives :
@tailwind base;
@tailwind components;
@tailwind utilities;
What kind of loader do I need in my webpack? In addition, I get this under the problems tab in my terimal :
On my browser terminal I get this in the console.log :
Any tips on how to fix this and start styling my app?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
写下:
而不是:
Write this:
instaead of :
使用此代码安装加载程序:
npm install --save-dev postcss-loader postcss
Use this code to install a loader:
npm install --save-dev postcss-loader postcss