当前位置: 首页 > news >正文

vite + react + tailwind(2025-08-25)

我知道react和tailwindcss但是我不知道vite要怎么配置,于是有了这篇文章,最终解决方法:

1、npm create vite@latest my-project
2、npm install tailwindcss @tailwindcss/vite
3、Add the @tailwindcss/vite plugin to your Vite configuration.
4、Add an @import to your CSS file that imports Tailwind CSS.
5、npm run dev

ref:https://tailwindcss.com/docs/installation/using-vite

lucide-react 图标的解决方案


大语言模型很强,但是因为它的知识不是最新的,占用了我一个小时的时间,还没有解决问题。
于是我尝试查看文档,所以这个时候官方文档的效率会更高。

我看到了这个哥们的文章,其实我也是个return react的人。

https://medium.com/@fasihuddin102/how-to-set-up-tailwindcss-in-a-react-vite-project-2025-edition-999e0541a493

“I didn’t write this article to teach TailwindCSS. I wrote it so you don’t waste 30 minutes like I did.”

⭐Final Thoughts
Whether you’re new to web development or a returning React dev like me, this setup guide will hopefully save you some confusion, stress, and StackOverflow detours.

AI is incredible, but you’re still the one behind the wheel. Use the tools wisely, stay curious, and never underestimate the power of good documentation.

If this post helped, consider clapping 👏, commenting your own experience, or sharing it with a fellow dev who’s fighting with their styling setup.

Happy coding!

同是天涯沦落人,相逢何必增相识。
如果这篇文章有帮助,请考虑点赞👍、评论分享您自己的经验,或者分享给其他人。

http://www.dtcms.com/a/350326.html

相关文章:

  • C++贪吃蛇---详细步骤
  • 2.4 Flink运行时架构:Task、SubTask、ExecutionGraph的关系
  • OPcache 高级技术文档:原理、监控与优化实践
  • Unity使用Sprite切割大图
  • JavaScript 性能优化实战:从理论到落地的技术文章大纲
  • 基于长短期记忆网络的多变量时间序列预测 LSTM
  • Redis 哨兵 Sentinel
  • 【沉浸式解决问题】NVIDIA 显示设置不可用。 您当前未使用连接到NVIDIA GPU 的显示器。
  • 实时监测蒸汽疏水阀的工作状态的物联网实时监控平台技术解析
  • VLLM的加速原理
  • 基于MATLAB实现支持向量机(SVM)进行预测备
  • 大模型的多机多卡训练
  • 神经网络|(十五)概率论基础知识-协方差标准化和皮尔逊相关系数
  • 亚马逊AWD美西新仓上线:旺季备货的效率革命与策略升级
  • 真实应急响应案例记录
  • 机器学习笔记
  • Neumann Networks for Linear Inverse Problems in Imaging论文阅读
  • CF2133D 鸡骑士
  • 基于遗传算法优化BP神经网络的时间序列预测 GA-BP
  • PNP机器人介绍:全球知名具身智能/AI机器人实验室介绍之多伦多大学机器人研究所
  • DeepSeek 14B模型本地部署与预训练实现方案
  • jsvmp是什么,如何使用
  • 入门Ubuntu操作系统
  • 深度学习:从手写数字识别案例认识pytorch框架
  • 用 GSAP + ScrollTrigger 打造沉浸式视频滚动动画
  • 《零基础学 C 语言文件顺序读写:fputc/fgetc 到 fread/fwrite 函数详解》
  • 并行算法与向量化指令集的实战经验
  • 【Linux内核实时】实时互斥锁 - sched_rt_mutex
  • 寂静之歌 单机+联机(Songs Of Silence)免安装中文版
  • 数据存储的思考——从RocketMQ和Mysql的架构入手