weapp-tailwindcss 3.1.1 → 3.2.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CHANGELOG.md +619 -0
  2. package/README_en.md +139 -0
  3. package/benchmark/.vscode/extensions.json +3 -0
  4. package/dist/cli.js +3 -3
  5. package/dist/cli.mjs +3 -3
  6. package/dist/core.d.ts +1 -1
  7. package/dist/core.js +3 -3
  8. package/dist/core.mjs +3 -3
  9. package/dist/{defaults-CBb6_9nJ.mjs → defaults-Cpt1fUNP.mjs} +5 -1
  10. package/dist/{defaults-BT3A8Rzc.js → defaults-Mf4eWves.js} +5 -1
  11. package/dist/defaults.js +1 -1
  12. package/dist/defaults.mjs +1 -1
  13. package/dist/gulp.js +4 -4
  14. package/dist/gulp.mjs +4 -4
  15. package/dist/{index-BatBMY3C.mjs → index-68y_DK7v.mjs} +3 -3
  16. package/dist/{index-C9cFs8_u.js → index-BeceVy3q.js} +1 -1
  17. package/dist/{index-DKNUquoz.mjs → index-Br8RI9kF.mjs} +18 -0
  18. package/dist/{index-DEWZ8_xX.mjs → index-Cc9Keh2y.mjs} +1 -1
  19. package/dist/{index-CarwQa1I.js → index-DCE5ieKW.js} +18 -0
  20. package/dist/{index-jf-1m663.js → index-DceUHJsx.js} +3 -3
  21. package/dist/index.js +6 -6
  22. package/dist/index.mjs +6 -6
  23. package/dist/{options-AIjWBFPo.js → options-CsgtOq1O.js} +20 -13
  24. package/dist/{options-D6Mza941.mjs → options-D44x0dJn.mjs} +20 -13
  25. package/dist/postcss.js +1 -1
  26. package/dist/postcss.mjs +1 -1
  27. package/dist/types.d.ts +11 -1
  28. package/dist/{v5-BV64BMJS.js → v5-BvCYBYO9.js} +3 -3
  29. package/dist/{v5-CH-EIloz.mjs → v5-F0XOH7NH.mjs} +3 -3
  30. package/dist/vite.js +4 -4
  31. package/dist/vite.mjs +4 -4
  32. package/dist/webpack.js +4 -4
  33. package/dist/webpack.mjs +4 -4
  34. package/dist/webpack4.js +3 -3
  35. package/dist/webpack4.mjs +3 -3
  36. package/package.json +67 -66
package/CHANGELOG.md ADDED
@@ -0,0 +1,619 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ## 3.1.1 (2024-3-30)
6
+
7
+ ### Chore
8
+
9
+ - 去除 `package.json` 里的 `optionalDependencies` 以减小安装依赖的大小,此时启用 `jsAstTool`: `ast-grep` 需要用户自己手动安装 `@ast-grep/napi`
10
+
11
+ ## 3.1.0 (2024-3-22)
12
+
13
+ ### Features
14
+
15
+ - 使用 `htmlparser` 的 `xml` 模式来解析 `wxml`
16
+ - 增加 `jsAstTool` 配置项,可选使用 `@ast-grep/napi` 来解析 `js ast`,速度可提升 `1.5`- `2` 倍多左右
17
+
18
+ ## 3.0.5 (2024-1-7)
19
+
20
+ ### Fixed
21
+
22
+ - Lock htmlparser2 version [#268](https://github.com/sonofmagic/weapp-tailwindcss/issues/268)
23
+
24
+ ## 3.0.4-3.0.0
25
+
26
+ <https://github.com/sonofmagic/weapp-tailwindcss/issues/259>
27
+
28
+ <https://weapp-tw.icebreaker.top/docs/migrations/v2>
29
+
30
+ ## 2.11.0 (2023-11-13)
31
+
32
+ ## Features
33
+
34
+ - 添加单独的 Nodejs API [#255](https://github.com/sonofmagic/weapp-tailwindcss/issues/255), [相关文档](https://weapp-tw.icebreaker.top/docs/quick-start/frameworks/api)
35
+
36
+ ## 2.10.1 (2023-10-17)
37
+
38
+ ## Fix
39
+
40
+ - 修复样式条件编译语法糖,uni-app 会在某些版本中破坏条件编译的注释,这时候需要这个插件去修复一下。
41
+
42
+ ## 2.10.0 (2023-10-16)
43
+
44
+ ## Features
45
+
46
+ - 添加 [uni-app-css-macro](https://weapp-tw.icebreaker.top/docs/quick-start/uni-app-css-macro) 样式条件编译语法糖相关功能
47
+
48
+ ## Chore
49
+
50
+ - 升级 `rollup` 相关依赖到 `4.x`
51
+
52
+ ## 2.9.3 (2023-09-28)
53
+
54
+ ## Features
55
+
56
+ - 添加 `tailwindcssBasedir` 配置项
57
+ - 异步化 `postcss` 以及缓存还有所有的插件
58
+
59
+ ## 2.9.2 ~ 2.9.1 (2023-09-19)
60
+
61
+ ## Features
62
+
63
+ - 建立缓存机制,大幅增加 `vite` 插件的热更新速度
64
+
65
+ ## Fixed
66
+
67
+ - mpx编译wxml属性值单引号问题 [#241](https://github.com/sonofmagic/weapp-tailwindcss/issues/241)
68
+
69
+ ## 2.9.0 (2023-09-18)
70
+
71
+ ## Features
72
+
73
+ - 建立缓存机制,大幅增加 `webpack` 插件的热更新速度
74
+
75
+ ## 2.8.4 (2023-09-08)
76
+
77
+ ## Fixed
78
+
79
+ - 修复由于使用 `eval` 导致 `jsHandler` 递归处理时的 `ast` 解析错误问题。
80
+
81
+ ## 2.8.3 (2023-09-08)
82
+
83
+ - 添加 `mergeVirtualHostAttributes` 的 `virtualHost` 虚拟节点支持
84
+
85
+ ## 2.8.0 (2023-08-15)
86
+
87
+ ## Features
88
+
89
+ - 默认使用 `jsEscapeStrategy` 的 `replace` 模式
90
+ - 重写了 `wxml` 解析器以代替正则匹配替换的方式,以做到更加精确的匹配
91
+ - 更加精准的 `customAttributes` 配置项,现在配置项中,使用字符串代表着,精确匹配标签或者属性,可以使用正则来匹配多个。
92
+
93
+ ## Chore
94
+
95
+ - 升级 `tailwindcss-patch` 相关的依赖到 `^2.1.0`
96
+
97
+ ## 2.7.0
98
+
99
+ ## Features
100
+
101
+ - 添加 `jsEscapeStrategy` 配置项,用于切换所有的 `js`字符串中,处理字符串和模板字面量的替换模式。
102
+ - 详细配置见 <https://weapp-tw.icebreaker.top/docs/api/interfaces/UserDefinedOptions#jsescapestrategy>
103
+
104
+ ## Chore
105
+
106
+ - 升级 `tailwindcss-patch` 和 `@tailwindcss-mangle` 相关依赖到 `2.x` 版本
107
+
108
+ ## 2.6.3 (2023-07-27)
109
+
110
+ ## Fixed
111
+
112
+ - 修复直接引用 `npm` 包时,不出现智能提示的问题
113
+
114
+ ## Chore
115
+
116
+ - 拆分 `@weapp-core` 相关的包引用
117
+ - 去除无用依赖,升级相关包到 `esm` 格式
118
+
119
+ ## 2.6.2 (2023-07-17)
120
+
121
+ ## Features
122
+
123
+ - 添加 `disabledDefaultTemplateHandler` 配置项,可以禁用默认的模板标签匹配转化器
124
+
125
+ ## Fixed
126
+
127
+ - 修复部分错误的 `injectAdditionalCssVarScope` 注入样式
128
+ - 修复因为英语水平差,造成长久以来的拼写问题:`templete -> template`
129
+
130
+ ## Chore
131
+
132
+ - 升级 `tailwindcss-patcher` 到 `1.2.7`
133
+
134
+ ## 2.6.1 (2023-07-17)
135
+
136
+ ### Features
137
+
138
+ - 添加 `jsPreserveClass` 配置项,用于处理 `tailwindcss` 和 `js` 转义字面量撞车的情况。
139
+ - 现在所有的默认值可以通过 `weapp-tailwindcss/defaults` 获取到了,
140
+
141
+ ### Fixed
142
+
143
+ - 修复带 `*` 的 `js` 字面量,由于和 `tailwindcss` 运行时冲突,导致错误转义的问题。
144
+
145
+ ## 2.6.0 (2023-07-11)
146
+
147
+ ### Features
148
+
149
+ - 添加 `injectAdditionalCssVarScope` 配置项,用于 `tailwindcss` 变量区域的重新注入
150
+
151
+ ### Chore
152
+
153
+ - 升级 `@csstools` 到最新版本,使用 `MIT-0` 协议
154
+ - 升级 `babel` 相关的依赖
155
+
156
+ ## 2.5.0~2.5.2 (2023-06-19)
157
+
158
+ ### Features
159
+
160
+ - 添加 `wxs` 支持,包含内联使用和引入的转义,并添加对应的配置项
161
+ - 添加多 `tailwindcss` 上下文的支持,用户可以在一个项目里,创建多个 `tailwindcss`上下文,使得不同的目录,应用不同的 `tailwindcss` 策略
162
+
163
+ ## 2.4.4 (2023-06-14)
164
+
165
+ ### Features
166
+
167
+ - 添加 `cssChildCombinatorReplaceValue` 配置项,允许用户自定义直接子代选择器行为
168
+ - 更精细化的处理了 css 选择器的转义逻辑
169
+
170
+ ## 2.4.3 (2023-06-10)
171
+
172
+ ### Fixed
173
+
174
+ - 修复class name 第一个css selector 为数字,导致的16进制选择器问题,导致小程序报错的问题,解决方案位添加首字母阻止\3转义
175
+
176
+ ## 2.4.2 (2023-05-25)
177
+
178
+ - 仓库改名为 `weapp-tailwindcss`
179
+ - 添加 `arbitraryvalues` 配置项,允许用户切换分割模式
180
+ - 使用 `typedoc` 来生成 `options` 的文档
181
+ - 重构 `mangle` 功能代码,添加对应的单元测试用例,现在的单元测试代码覆盖率已经提升到了 `99%`
182
+
183
+ ## 2.4.1 (2023-05-23)
184
+
185
+ 修复了 tarojs vue3 框架下,由于vue3产生静态节点,产生静态的html字符串,导致js转义字符串时,没有匹配到相应字符串的问题。
186
+ 不过这个这个改动也导致我们在写 tailwindcss class 的时候,使用任意值,无法在里面写双引号了。
187
+ 什么意思呢?
188
+
189
+ ```js
190
+ after:content-["你好啊,我很无聊"] ×
191
+ after:content-['你好啊,我很无聊'] √
192
+ ```
193
+
194
+ 所以接下来会开放配置项,允许用户自行开启关闭这个问题,毕竟目前只在 taro vue3 里面出现。
195
+
196
+ ## 2.4.0 (2023-05-22)
197
+
198
+ - 最小支持 nodejs 版本为 16
199
+
200
+ ## 2.3.1 (2023-05-18)
201
+
202
+ ### Chore
203
+
204
+ - 增加 `./webpack` 路径下的导出和类型,现在都可以使用 `xxx/webpack`,`xxx/vite`,`xxx/gulp`,`xxx/postcss`,`xxx/replace` 这类的方式来处理了
205
+ - 更完善的 readme.md
206
+
207
+ ### Fixed
208
+
209
+ - 修复ts直接引入 `./` 下的 `type`智能提示问题
210
+
211
+ ## 2.3.0 (2023-05-16)
212
+
213
+ ### Features
214
+
215
+ - 添加 `mangle` 配置项,可以对 `tailwindcss` 生成的类名进行缩短以及混淆
216
+ - 添加 `esm` 支持
217
+
218
+ ### Chores
219
+
220
+ - 使用 `exports` 导出项目,去除根目录下的 `.d.ts`
221
+ - 升级 `pnpm` from v7 to v8
222
+ - 去除所有 `webpack4` 相关的依赖
223
+ - 使用 `jest` 测试 `cjs` , `vitest` 测试 `vite` 相关 `case`
224
+ - 采用 `Github Action` 进行正式发布以及自动生成 `github changelog`
225
+
226
+ ## 2.2.0 (2023-05-07)
227
+
228
+ ### Features
229
+
230
+ - class选择器支持 unicode
231
+ - 重写了转义核心方法,优化性能
232
+
233
+ ### Fixed
234
+
235
+ - tarojs 在热更新时,保存非 `[jt]sx` 文件,比如 `tailwind.config.js` / `xx.scss` 文件,导致样式丢失的问题
236
+
237
+ ### Breaking Changes
238
+
239
+ - 去除所有的 v1 版本的插件,重构代码和更改目录,如果你还是想用 v1 插件,请锁定你的版本在 `2.1.5` 以下。
240
+ - 去除了无用的配置项
241
+
242
+ ## 2.1.5 (2023-05-04)
243
+
244
+ ### Features
245
+
246
+ - `js` 文件进行转义时,自动判断格式是 `cjs` 还是 `esm`
247
+ - 现在能针对 `eval` 包裹的 `js`脚本进行转义了
248
+ - 去除所有 `mangle` 相关代码,相关功能现在到 [tailwindcss-mangle](https://github.com/sonofmagic/tailwindcss-mangle)
249
+
250
+ ### Chores
251
+
252
+ - 给之前的 `v1` 版本的插件打上 `deprecated` 标记,添加对应的 `jsdoc`
253
+ - 整理目录去除 `v1` 版本的 `markdown` 文件目录,相关转移到了 `website` 中
254
+
255
+ ## 2.1.4 (2023-04-30)
256
+
257
+ ### Fixed
258
+
259
+ - 默认按照环境变量来决定是否压缩js代码,同时添加`minifiedJs`配置项手动进行指定 [[#164](https://github.com/sonofmagic/weapp-tailwindcss-webpack-plugin/issues/164)]
260
+ - 修复 `webpack filesystem` 缓存,导致的二次编译结果错误问题。这是由于启用文件缓存后,`webpack`二次打包时候直接使用缓存,而不去触发`postcss`相关插件导致的。
261
+
262
+ ## 2.1.3 (2023-04-28)
263
+
264
+ ### Chores
265
+
266
+ - 升级 `tailwindcss-patch` 的最小版本,修复 `nodejs14` `npm preinstall hook` 报错的问题
267
+ - 把 `tailwindcss` 打补丁最低版本降到 `3.0.0`
268
+ - 默认 `jsMatcher` 现在会包括 `.cjs`/`.mjs` 这种文件后缀名了
269
+
270
+ ## 2.1.2 (2023-04-22)
271
+
272
+ ### Features
273
+
274
+ - 支持作为 `gulp` 插件使用 [#161](https://github.com/sonofmagic/weapp-tailwindcss-webpack-plugin/issues/161)
275
+
276
+ ## 2.1.1 (2023-04-17)
277
+
278
+ ### Fixed
279
+
280
+ 修复 `bg-[url('img_src')]` 写法失效的问题 [#158](https://github.com/sonofmagic/weapp-tailwindcss-webpack-plugin/issues/158)
281
+
282
+ ## 2.1.0 (2023-04-12)
283
+
284
+ ### Features
285
+
286
+ - jsHandler 增强,添加了针对模板字符串的处理
287
+ - [tailwindcss-patch](https://www.npmjs.com/package/tailwindcss-patch) 如今作为一个独立的 `npm` 包来依赖了
288
+ - 增强了所有字面量分割的方式,增强了针对 `vue3` 静态模板字符串的处理方式。
289
+
290
+ ## 2.0.2 - 2.0.4 (2023-04-07)
291
+
292
+ ### Docs
293
+
294
+ - <https://weapp-tw.icebreaker.top/>
295
+
296
+ ### Fixed
297
+
298
+ - 修复因 `typescript` 升级 `5.x` 导致的 `dts` 路径错误问题
299
+ - 展开 `:is()` [#153](https://github.com/sonofmagic/weapp-tailwindcss-webpack-plugin/issues/153)
300
+
301
+ ## 2.0.1 (2023-03-21)
302
+
303
+ ### Fixed
304
+
305
+ - `rpx` 支持,在`patch`时,语法上统一转化为单引号字符串数组。
306
+
307
+ ### Chore
308
+
309
+ - 大量的文档优化
310
+
311
+ ## 1.12.8 (2022-12-17)
312
+
313
+ ### Features
314
+
315
+ - 增加 `customReplaceDictionary` 的 `simple`/`complex`模式,`simple`为更简短的`className`
316
+ - `replace` 导出所有,用于自定义运行时对 `replace` 行为进行二次封装。
317
+
318
+ ## 1.12.7 (2022-12-14)
319
+
320
+ ### Fixed
321
+
322
+ - typescript dts fixed
323
+
324
+ ### Chore
325
+
326
+ 文档更新,添加 `customAttributes` 案例
327
+
328
+ ## 1.12.6 (2022-12-06)
329
+
330
+ ### Features
331
+
332
+ - 实现 `customAttributes` `*`全匹配的逻辑
333
+
334
+ ## 1.12.4 (2022-11-25)
335
+
336
+ ### Features
337
+
338
+ - 额外导出 `UniAppWeappTailwindcssWebpackPluginV5` 用于 `uni-app` 的 `vue/cli 5` 版本
339
+
340
+ ### Chore
341
+
342
+ - 添加 `uni-app-webpack5` Demo 用于 `vue/cli 5` 版本
343
+ - uni-app Readme 完善
344
+
345
+ ## 1.12.(0-3) (2022-11-20)
346
+
347
+ ### Features
348
+
349
+ - 添加 `supportCustomLengthUnitsPatch` 配置项,默认开启。
350
+
351
+ 自从`tailwindcss 3.2.0`对任意值添加了长度单位的校验后,小程序中的`rpx`这个`wxss`单位,由于不在长度合法名单中,于是被识别成了颜色,导致与预期不符,详见:[issues/110](https://github.com/sonofmagic/weapp-tailwindcss-webpack-plugin/issues/110)。
352
+
353
+ 所以这个选项是用来给`tailwindcss`运行时,自动打上一个支持`rpx`单位的补丁。默认开启,在绝大部分情况下,你都可以忽略这个配置项,除非你需要更高级的自定义。
354
+
355
+ 比较和处理的策略详见 [patcher.ts](./src/tailwindcss/patcher.ts)
356
+
357
+ - 升级 `rollup` 主版本和相关包到 `3`, 优化 `rollup` 打包生成的 `chunk`
358
+ - 添加 `cli`, 目前添加了 `patch` 指令,可手动给 `tailwindcss` 打上 `patch`。具体执行 `npx weapp-tailwindcss patch` or `npx weapp-tw patch`
359
+ - 在安装这个包后,会自动检索 `tailwindcss` 运行时源码,打上支持 `rpx` 的 `patch`。不过这种自动检索存在一定的缺陷,比如在第一次运行的时候会不生效,第二次运行的时候才生效了。这是因为 nodejs 运行时先加载好了 `tailwindcss` ,然后再来运行插件,自动给 `tailwindcss` 运行时打上 `patch`。此时由于 `tailwindcss` 模块已经加载,所以 `patch` 在第一次运行时不生效,ctrl+c 关闭之后,再次运行才生效。这种情况可以使用:
360
+
361
+ ```
362
+ "scripts": {
363
+ + "postinstall": "weapp-tw patch"
364
+ }
365
+ ```
366
+
367
+ 这样的 `npm hook` 来自动打 `patch`
368
+
369
+ ## 1.11.6 (2022-11-06)
370
+
371
+ ### Fixed
372
+
373
+ - 使用 `utf-8` 中文字体进行`wxml`条件判断时,会默认进行`unicode`转义的bug.
374
+
375
+ ## 1.11.5 (2022-10-31)
376
+
377
+ ### Chore
378
+
379
+ - 去除 `vite` 插件使用 `windicss` 和 `unocss` 的命令行警告
380
+ - 添加 `unocss` 的使用文档和案例
381
+
382
+ ## 1.11.3 (2022-10-20)
383
+
384
+ ### Features
385
+
386
+ - `customAttributes` 现在允许使用 `Map` 类型了,可以自定义匹配标签正则。
387
+
388
+ ### Chore
389
+
390
+ - `webpack jsx test case` 完善
391
+
392
+ ## 1.11.3 (2022-10-17)
393
+
394
+ ### Features
395
+
396
+ - 现在针对 `wxml` 的匹配默认会更加精准,同时也影响 `customAttributes` 配置,详见 [test/regexp-maker.test.ts](test/regexp-maker.test.ts)
397
+ - `customAttributes` 现在允许正则类型了。
398
+
399
+ ## 1.11.(1-2) (2022-10-7)
400
+
401
+ ### Chore
402
+
403
+ - 更改 `readme` `options` 的排版, 去除原先的 `md table`,让阅读体验好一些。
404
+ - 去除 `vite plugin` 的重复性创建 `function` 方法
405
+
406
+ ## 1.11.0 (2022-10-6)
407
+
408
+ ### Features
409
+
410
+ - 增加 `customAttributes` 配置,用于自定义wxml标签上的转化属性,默认转化所有的 `class` 和 `hover-class`。
411
+ - 增加 `customReplaceDictionary` 配置,自定义转化 `class`名称字典,你可以使用这个选项来简化生成的 `class`
412
+
413
+ ## 1.10.0 (2022-10-2)
414
+
415
+ ### Features
416
+
417
+ - 编写了第二版本的 `jsx` 处理方法,替换第一版本。
418
+ - 支持 `vue2/vue3` + `tsx` 开发 [#100](https://github.com/sonofmagic/weapp-tailwindcss-webpack-plugin/issues/100)
419
+
420
+ ## 1.9.3 (2022-09-22)
421
+
422
+ ### Features
423
+
424
+ - 以模板为主的 `uni-app`,`mina`等等的 `wxml` 变量处理方式,当遇到二元运算符时,忽略运算符中,字符串字面量的转义。
425
+
426
+ ## 1.9.2 (2022-09-10)
427
+
428
+ ### Fixed
429
+
430
+ - `tailwindcss` 伪元素 `jit` 的自定义特殊字符。
431
+
432
+ ### Chore
433
+
434
+ - 重构重命名核心方法,为 `v2` 做准备。
435
+
436
+ ## 1.9.1 (2022-09-08)
437
+
438
+ ### Features
439
+
440
+ - `vite` 插件,可以直接注册,不需要再引入 `postcss` 插件
441
+
442
+ ### Chore
443
+
444
+ - 暂时去除 `mangle` 配置
445
+ - 去除 `lodash.groupby` 引用,减少包的体积
446
+
447
+ ## 1.9.0 (2022-09-05)
448
+
449
+ ### Features
450
+
451
+ - 添加 `mangle` 配置,用于压缩混淆 `className`,详见 [mangle.md](./docs/mangle.md)
452
+ - 重构 `transformSync`, 废弃 `mpRulePreflight`
453
+ - `weapp-tailwindcss-webpack-plugin/replacer` 额外暴露 `replaceEscapedCss`
454
+ - 暴露 `weapp-tailwindcss-webpack-plugin/mangle` 插件
455
+
456
+ ## 1.8.1 (2022-08-22)
457
+
458
+ ### Fixed
459
+
460
+ - [using-arbitrary-variants](https://tailwindcss.com/docs/hover-focus-and-other-states#using-arbitrary-variants) 自定义选择器类名支持与修复 [[#84](https://github.com/sonofmagic/weapp-tailwindcss-webpack-plugin/issues/84)]
461
+
462
+ ## 1.8.0 (2022-08-17)
463
+
464
+ ### Features
465
+
466
+ - 添加 `tailwindcss` 默认伪元素的 `--tw-content` 变量初始值
467
+ - 依赖处理方式改变,`postcss` 和 `postcss-selector-parser` 从编译时打入,变为安装时连带
468
+ - 精细化的移除选择器,当发现不支持的伪类选择器时,原先的策略是把 `Rule` 整个移除,现在会遍历这个 `Rule` 的所有选择器,只把不支持的选择器的移除,当且仅当所有的选择器都被移除时,这个 `Rule` 才被整个移除
469
+
470
+ ### Fixed
471
+
472
+ - 修复 `vite` 版本 `tailwindcss` 默认注入变量选择器 `undefined` 的问题
473
+
474
+ ## 1.7.3 (2022-08-15)
475
+
476
+ ### Features
477
+
478
+ - 允许用户使用 `replaceUniversalSelectorWith` 选项来自定义`css`全局选择器`*`的替换值 [issue[#81](https://github.com/sonofmagic/weapp-tailwindcss-webpack-plugin/issues/81)]
479
+
480
+ ## 1.7.2 (2022-08-15)
481
+
482
+ ### Fixed
483
+
484
+ - 修复在伪元素中使用`*`自动被替换的问题 [#79](https://github.com/sonofmagic/weapp-tailwindcss-webpack-plugin/issues/79)
485
+
486
+ ### Chore
487
+
488
+ - 更改转义字典表,添加 `*`,`\\`和 `"` 的默认转义,规范化以前转义生成的`_[code]_`。
489
+
490
+ ## 1.7.1 (2022-08-06)
491
+
492
+ ### Chore
493
+
494
+ - 更新打包成`app`文档和模板选择文档
495
+ - 依赖更新
496
+
497
+ ## 1.7.0 (2022-08-04)
498
+
499
+ ### Features
500
+
501
+ - 支持 `taro 3.5`,用法如下:
502
+
503
+ 简单修改 Taro 的编译配置即可切换使用 Webpack4 或 Webpack5 进行编译:
504
+
505
+ ```js
506
+ /** config/index.js */
507
+ const config = {
508
+ // 自定义编译工具,可选 'Webpack4' 或 'Webpack5'
509
+ compiler: 'webpack5'
510
+ }
511
+ ```
512
+
513
+ 其中:
514
+
515
+ - `Webpack4` 使用 `TaroWeappTailwindcssWebpackPluginV4` 进行注册
516
+ - `Webpack5` 使用 `TaroWeappTailwindcssWebpackPluginV5` 进行注册
517
+
518
+ ## 1.6.9 (2022-07-29)
519
+
520
+ ### Features
521
+
522
+ - 添加 `disabled` 配置项,用来表示是否禁用该插件,默认为 `false`,一般用于多平台构建,有些平台比如 `h5` 不需要开启此插件,所以可以根据环境变量进行禁用。
523
+ - `onUpdate` 这个生命周期 `hook` 增加传入参数,即编译前的 `rawSource` 和 编译后的 `newSource` 作为第二和第三个参数,用于插件调试和文件内容比较。
524
+
525
+ ### Docs & Demos
526
+
527
+ - 添加 `HBuilderX` 创建的项目的[使用方式](https://github.com/sonofmagic/uni-app-vue2-tailwind-hbuilder-template#readme) 和 [Demo 项目](https://github.com/sonofmagic/uni-app-vue2-tailwind-hbuilder-template)
528
+
529
+ ## 1.6.8 (2022-07-01)
530
+
531
+ ### Features
532
+
533
+ - 添加 `cssPreflightRange` 配置项 [pull/62](https://github.com/sonofmagic/weapp-tailwindcss-webpack-plugin/pull/62),用来限制全局选择器影响的 `dom` 范围,从而增加或者减少 `cssPreflight` 注入的 `dom`,具体的使用方式见 `README.md`
534
+
535
+ ## 1.6.7 (2022-06-22)
536
+
537
+ ### Features
538
+
539
+ - 不再锁定 `@babel/*` 的具体版本
540
+
541
+ ### Fixed
542
+
543
+ - 修复 `remax` 版本的 `hoverClassName` 不处理的问题。(`remax`命名比较特殊)
544
+
545
+ ## 1.6.6 (2022-06-21)
546
+
547
+ ### Features
548
+
549
+ - 添加 `tailwindcss` 的 `dark mode` (media) 支持。
550
+ - 现在 `uni-app` 和 `taro` 都会同时转义 `class` 和 `hover-class` 里的内容了 [uni-app-vite-vue3-tailwind-vscode-template/issues/3](https://github.com/sonofmagic/uni-app-vite-vue3-tailwind-vscode-template/issues/3)。
551
+
552
+ ### Fixed
553
+
554
+ - 修复 `taro vue3` 版本 `babel` 处理导致打包失败的问题。
555
+
556
+ ## 1.6.5 (2022-06-19)
557
+
558
+ ### Improvement
559
+
560
+ - 优化 `ts` 生成的 `.d.ts` 文件的 `npm` 包索引。
561
+
562
+ ## 1.6.4 (2022-06-11)
563
+
564
+ ### Fixed
565
+
566
+ [issues/53](https://github.com/sonofmagic/weapp-tailwindcss-webpack-plugin/issues/53) 在`BaseJsxWebpackPlugin`的新文件开始处理前强制重置`replacer`状态。(Thanks to [sandro-qiang](https://github.com/sandro-qiang))
567
+
568
+ ## 1.6.2 (2022-06-10)
569
+
570
+ ## Improvement
571
+
572
+ - 优化被分割的 `vite`,`postcss` 的 `d.ts` 智能提示
573
+
574
+ ## 1.6.1 (2022-06-08)
575
+
576
+ ## Improvement
577
+
578
+ - 优化 `Tree-shaking` ,减小`npm`包打包体积
579
+
580
+ ## 1.6.0 (2022-06-08)
581
+
582
+ ### Fixed
583
+
584
+ [issues/50](https://github.com/sonofmagic/weapp-tailwindcss-webpack-plugin/issues/50) `vite` 插件依赖 `webpack` 问题
585
+
586
+ ### Breaking change
587
+
588
+ `vite` 引入插件的方式,改为:
589
+
590
+ ```js
591
+ import vwt from 'weapp-tailwindcss-webpack-plugin/vite'
592
+ import postcssWeappTailwindcssRename from 'weapp-tailwindcss-webpack-plugin/postcss'
593
+ ```
594
+
595
+ 详见 [vite.config.ts](https://github.com/sonofmagic/weapp-tailwindcss-webpack-plugin/blob/main/demo/uni-app-vue3-vite/vite.config.ts)
596
+
597
+ ## 1.5.0 (2022-06-01)
598
+
599
+ ### Fixed
600
+
601
+ [issues/48](https://github.com/sonofmagic/weapp-tailwindcss-webpack-plugin/issues/48) Source map 指向错误问题.
602
+
603
+ ### Breaking change
604
+
605
+ 更改了兼容 `webpack 4/5` 的 `react` 版本插件的实现。原先是对 `webpack` `emit` 后的产物进行分析和替换,现在新的实现为: 动态创建一个新的 `jsx-rename-loader`,它运行在 `babel-loader` 之后,对 `babel-loader` 的产物进行替换。这样最终生成的 `Source map` 就不会存在指向错误问题了。
606
+
607
+ 收到影响的 `Plugin`:
608
+
609
+ - **taro react** : `TaroWeappTailwindcssWebpackPluginV4`
610
+ - **rax react** : `RaxTailwindcssWebpackPluginV5`
611
+ - **remax react** : `RemaxWeappTailwindcssWebpackPluginV4`
612
+
613
+ ## 1.4.4 (2022-05-19)
614
+
615
+ ## 1.4.3 (2022-05-18)
616
+
617
+ ## 1.4.0 (2022-05-15)
618
+
619
+ Breaking change: handle `wxml` with `regex` instead of `wxml-ast` [issues/38](https://github.com/sonofmagic/weapp-tailwindcss-webpack-plugin/issues/38).