您可能需要适当的加载程序来处理此文件类型,目前没有配置加载程序来为 TailwindCss 处理此文件

发布于 2025-01-14 17:00:18 字数 1206 浏览 0 评论 0原文

我是第一次使用 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 中需要什么样的加载器?此外,我在终端的问题选项卡下得到了这个: SS of Problem

在我的浏览器终端上,我在 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 : SS of problem

On my browser terminal I get this in the console.log :
enter image description here

Any tips on how to fix this and start styling my app?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

预谋 2025-01-21 17:00:18

写下:

@import 'tailwindcss/base';

@import 'tailwindcss/components';

@import 'tailwindcss/utilities';

而不是:

@tailwind base;
@tailwind components;
@tailwind utilities

Write this:

@import 'tailwindcss/base';

@import 'tailwindcss/components';

@import 'tailwindcss/utilities';

instaead of :

@tailwind base;
@tailwind components;
@tailwind utilities
拍不死你 2025-01-21 17:00:18

使用此代码安装加载程序:npm install --save-dev postcss-loader postcss

Use this code to install a loader: npm install --save-dev postcss-loader postcss

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文