Skip to content

Commit 4ba7fe5

Browse files
committed
chore(deps): upgrade
1 parent b3de549 commit 4ba7fe5

4 files changed

Lines changed: 47 additions & 36 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "module",
44
"version": "0.0.0",
55
"private": true,
6-
"packageManager": "pnpm@10.13.1",
6+
"packageManager": "pnpm@10.14.0",
77
"description": "把tailwindcss jit引擎,带给小程序开发者们! bring tailwindcss jit engine to miniprogram developers!",
88
"author": "ice breaker <1324318532@qq.com>",
99
"license": "MIT",
@@ -190,7 +190,7 @@
190190
"jsdom": "^26.1.0",
191191
"klaw": "^4.1.0",
192192
"lightningcss": "^1.30.1",
193-
"lint-staged": "^16.1.2",
193+
"lint-staged": "^16.1.4",
194194
"local-pkg": "^1.1.1",
195195
"lodash": "^4.17.21",
196196
"lodash-es": "^4.17.21",

pnpm-lock.yaml

Lines changed: 22 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@ packages:
66
- benchmark
77
- '!tailwindcss-weapp'
88
- '!**/test/**'
9+
910
catalogs:
1011
tailwindcss3:
1112
tailwindcss: ^3.4.17
1213
tailwindcss4:
1314
tailwindcss: ^4.1.11
1415
tailwindcss4: npm:tailwindcss@^4.1.11
16+
1517
onlyBuiltDependencies:
1618
- '@tailwindcss/oxide'
19+
- '@tarojs/binding'
20+
- '@tarojs/cli'
1721
- esbuild

website/blog/2025/8/v4.2-release.mdx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
1+
{/* truncate */}
2+
13
# weapp-tailwindcss 已支持 uni-app x 多端构建
24

35
## 前言
46

5-
[`uni-app x`](https://doc.dcloud.net.cn/uni-app-x/) 是一个非常强大的跨多端解决方案,可以说是国内跨平台编译技术的天花板了
7+
[`uni-app x`](https://doc.dcloud.net.cn/uni-app-x/) `DCloud` 团队开发的跨平台编译方案,可将同一份代码编译到 Web、小程序、Android、iOS、鸿蒙等多端
68

7-
最近,我很荣幸在 `weapp-tailwindcss@4.2.x` 版本中,适配了 `uni-app x` 的多端构建。
9+
最近,我很荣幸在 `weapp-tailwindcss@4.2.x` 版本中,适配了 `uni-app x` 的多端构建,使 `Tailwind CSS` 的原子化样式能够无缝应用于多端项目
810

9-
并借助 `uni-app x` 的能力,把 `tailwindcss` 原子化样式方案,同时带入到 `Web`,`小程序`, `安卓`,`IOS`, `鸿蒙` 等多端开发中!
11+
所以就有了这篇文章,给大家介绍(****)一下怎么在 `uni-app x` 项目中,集成 `weapp-tailwindcss` 这个样式解决方案。
1012

1113
## 快速集成
1214

1315
### 0. 创建项目
1416

15-
使用最新版本 `Hbuilderx` 创建一个 `uni-app x` 项目,然后执行
17+
使用最新版本 `Hbuilderx` 创建一个 `uni-app x` 项目,然后在项目根目录执行
1618

17-
```bash npm2yarn
19+
```bash
1820
npm init -y
1921
```
2022

2123
初始化一个 `package.json` 文件 (当然你也可以手动创建)
2224

23-
### 1. 安装并引入 tailwindcss3
24-
25+
### 1. 安装并引入 tailwindcss@3
2526

26-
```bash npm2yarn
27+
```bash
2728
# 安装 tailwindcss@3 版本的依赖
2829
npm i -D tailwindcss@3 postcss autoprefixer
29-
```
30-
31-
```bash npm2yarn
3230
# 初始化一个 tailwind.config.js 文件
3331
npx tailwindcss init
3432
```
@@ -47,7 +45,7 @@ npx tailwindcss init
4745

4846
在项目目录下,执行:
4947

50-
```bash npm2yarn
48+
```bash
5149
npm i -D weapp-tailwindcss
5250
```
5351

@@ -62,15 +60,15 @@ npm i -D weapp-tailwindcss
6260

6361
想知道原因的同学可以查看 [**这个链接**](https://tw.icebreaker.top/docs/quick-start/this-plugin)
6462

65-
### 3. uni-app-x 注册 weapp-tailwindcss
63+
### 3. uni-app x 中注册 weapp-tailwindcss
6664

67-
#### 0. 创建工具类
65+
#### 3.0. 创建辅助函数
6866

6967
在项目中创建 `shared.js` 文件,用于存放一些工具函数:
7068

7169
```js title="shared.js"
7270
const path = require('node:path')
73-
71+
// 绝对路径处理
7472
function r(...args) {
7573
return path.resolve(__dirname, ...args)
7674
}
@@ -80,7 +78,7 @@ module.exports = {
8078
}
8179
```
8280

83-
#### 1. 注册插件
81+
#### 3.1. 配置 `Vite`
8482

8583
创建 `vite.config.ts` 文件,注册插件:
8684

@@ -116,7 +114,7 @@ export default defineConfig({
116114
});
117115
```
118116

119-
#### 2. 更改 tailwindcss 配置
117+
#### 3.2. 更改 `tailwindcss` 配置
120118

121119
你需要在 `tailwind.config.js``content` 配置中,使用绝对路径去包括所有的提取文件
122120

@@ -136,7 +134,7 @@ module.exports = {
136134

137135
```
138136

139-
> 假如你需要从更多的目录/文件中提取 `CSS Token`,你需要添加更多的 `glob` 表达式在 `content` 配置中
137+
> 如需从更多目录提取样式 `token`,可按需扩展 `content`
140138
141139
---
142140

@@ -205,6 +203,8 @@ IOS 模拟器,需要你有 Mac 才能运行,IOS 调试需要你有苹果手
205203

206204
`uni-app x` 是一个 **庞大的工程**, `DCloud` 团队能做出这样的技术解决方案,令人倾佩。
207205

206+
假如你遇到什么问题,可以在 [weapp-tailwindcss](https://github.com/sonofmagic/weapp-tailwindcss)`issue/disscussions` 中提出。
207+
208208
## 配置好的模板
209209

210210
https://github.com/icebreaker-template/uni-app-x-hbuilderx
@@ -215,6 +215,6 @@ https://github.com/icebreaker-template/uni-app-x-hbuilderx
215215

216216
[uni-app x 官方文档](https://doc.dcloud.net.cn/uni-app-x/)
217217

218-
[weapp-tailwindcss官网](https://tw.icebreaker.top/)
218+
[weapp-tailwindcss 官网](https://tw.icebreaker.top/)
219219

220220
[weapp-tailwindcss 的 uni-app x 专题](https://tw.icebreaker.top/docs/uni-app-x)

0 commit comments

Comments
 (0)