weapp-tailwindcss 2.9.1 → 2.9.3
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.
- package/README.md +13 -9
- package/dist/cache/index.d.ts +5 -2
- package/dist/cli.js +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/gulp.js +15 -11
- package/dist/gulp.mjs +15 -11
- package/dist/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/dist/{options-b96f6338.js → options-09ebba08.js} +56 -17
- package/dist/{options-f70d1c6f.mjs → options-63407615.mjs} +56 -18
- package/dist/postcss/index.d.ts +2 -2
- package/dist/types.d.ts +3 -1
- package/dist/vite.js +110 -106
- package/dist/vite.mjs +110 -106
- package/dist/webpack.js +15 -13
- package/dist/webpack.mjs +15 -13
- package/package.json +32 -28
package/dist/webpack.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { g as getOptions, a as createTailwindcssPatcher, _ as __awaiter } from './options-63407615.mjs';
|
|
1
2
|
import path from 'node:path';
|
|
2
3
|
import fs from 'node:fs';
|
|
3
|
-
import { g as getOptions, a as createTailwindcssPatcher } from './options-f70d1c6f.mjs';
|
|
4
4
|
import { a as pluginName } from './postcss-55ed4d42.mjs';
|
|
5
5
|
import { g as getGroupedEntries, r as removeExt } from './defaults-d2c66d23.mjs';
|
|
6
6
|
import { c as createDebug } from './index-84c7aa87.mjs';
|
|
@@ -26,7 +26,7 @@ import 'md5';
|
|
|
26
26
|
import 'postcss-selector-parser';
|
|
27
27
|
import 'debug';
|
|
28
28
|
|
|
29
|
-
const debug = createDebug('');
|
|
29
|
+
const debug = createDebug('processAssets: ');
|
|
30
30
|
class UnifiedWebpackPluginV5 {
|
|
31
31
|
constructor(options = {}) {
|
|
32
32
|
if (options.customReplaceDictionary === undefined) {
|
|
@@ -36,7 +36,7 @@ class UnifiedWebpackPluginV5 {
|
|
|
36
36
|
this.appType = this.options.appType;
|
|
37
37
|
}
|
|
38
38
|
apply(compiler) {
|
|
39
|
-
const { mainCssChunkMatcher, disabled, onLoad, onUpdate, onEnd, onStart, styleHandler, patch, templateHandler, jsHandler, setMangleRuntimeSet, runtimeLoaderPath, cache } = this.options;
|
|
39
|
+
const { mainCssChunkMatcher, disabled, onLoad, onUpdate, onEnd, onStart, styleHandler, patch, templateHandler, jsHandler, setMangleRuntimeSet, runtimeLoaderPath, cache, tailwindcssBasedir } = this.options;
|
|
40
40
|
if (disabled) {
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
@@ -45,7 +45,9 @@ class UnifiedWebpackPluginV5 {
|
|
|
45
45
|
const { ConcatSource, RawSource } = sources;
|
|
46
46
|
const twPatcher = createTailwindcssPatcher();
|
|
47
47
|
function getClassSet() {
|
|
48
|
-
return twPatcher.getClassSet(
|
|
48
|
+
return twPatcher.getClassSet({
|
|
49
|
+
basedir: tailwindcssBasedir
|
|
50
|
+
});
|
|
49
51
|
}
|
|
50
52
|
onLoad();
|
|
51
53
|
const loader = runtimeLoaderPath !== null && runtimeLoaderPath !== void 0 ? runtimeLoaderPath : path.resolve(__dirname, './weapp-tw-runtime-loader.js');
|
|
@@ -67,10 +69,10 @@ class UnifiedWebpackPluginV5 {
|
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
71
|
});
|
|
70
|
-
compilation.hooks.processAssets.
|
|
72
|
+
compilation.hooks.processAssets.tapPromise({
|
|
71
73
|
name: pluginName,
|
|
72
74
|
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
73
|
-
}, (assets) => {
|
|
75
|
+
}, (assets) => __awaiter(this, void 0, void 0, function* () {
|
|
74
76
|
onStart();
|
|
75
77
|
debug('start');
|
|
76
78
|
for (const chunk of compilation.chunks) {
|
|
@@ -91,7 +93,7 @@ class UnifiedWebpackPluginV5 {
|
|
|
91
93
|
const hash = cache.computeHash(rawSource);
|
|
92
94
|
const cacheKey = file;
|
|
93
95
|
cache.calcHashValueChanged(cacheKey, hash);
|
|
94
|
-
cache.process(cacheKey, () => {
|
|
96
|
+
yield cache.process(cacheKey, () => {
|
|
95
97
|
const source = cache.get(cacheKey);
|
|
96
98
|
if (source) {
|
|
97
99
|
compilation.updateAsset(file, source);
|
|
@@ -122,7 +124,7 @@ class UnifiedWebpackPluginV5 {
|
|
|
122
124
|
for (let i = 0; i < groupedEntries.js.length; i++) {
|
|
123
125
|
const [file, originalSource] = groupedEntries.js[i];
|
|
124
126
|
const cacheKey = removeExt(file);
|
|
125
|
-
cache.process(cacheKey, () => {
|
|
127
|
+
yield cache.process(cacheKey, () => {
|
|
126
128
|
const source = cache.get(cacheKey);
|
|
127
129
|
if (source) {
|
|
128
130
|
compilation.updateAsset(file, source);
|
|
@@ -163,7 +165,7 @@ class UnifiedWebpackPluginV5 {
|
|
|
163
165
|
const hash = cache.computeHash(rawSource);
|
|
164
166
|
const cacheKey = file;
|
|
165
167
|
cache.calcHashValueChanged(cacheKey, hash);
|
|
166
|
-
cache.process(cacheKey, () => {
|
|
168
|
+
yield cache.process(cacheKey, () => {
|
|
167
169
|
const source = cache.get(cacheKey);
|
|
168
170
|
if (source) {
|
|
169
171
|
compilation.updateAsset(file, source);
|
|
@@ -172,8 +174,8 @@ class UnifiedWebpackPluginV5 {
|
|
|
172
174
|
else {
|
|
173
175
|
return false;
|
|
174
176
|
}
|
|
175
|
-
}, () => {
|
|
176
|
-
const css = styleHandler(rawSource, {
|
|
177
|
+
}, () => __awaiter(this, void 0, void 0, function* () {
|
|
178
|
+
const css = yield styleHandler(rawSource, {
|
|
177
179
|
isMainChunk: mainCssChunkMatcher(file, this.appType)
|
|
178
180
|
});
|
|
179
181
|
const source = new ConcatSource(css);
|
|
@@ -185,13 +187,13 @@ class UnifiedWebpackPluginV5 {
|
|
|
185
187
|
key: cacheKey,
|
|
186
188
|
source
|
|
187
189
|
};
|
|
188
|
-
});
|
|
190
|
+
}));
|
|
189
191
|
}
|
|
190
192
|
debug('css handle finish, total: %d, no-cached: %d', groupedEntries.css.length, noCachedCount);
|
|
191
193
|
}
|
|
192
194
|
debug('end');
|
|
193
195
|
onEnd();
|
|
194
|
-
});
|
|
196
|
+
}));
|
|
195
197
|
});
|
|
196
198
|
}
|
|
197
199
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.3",
|
|
4
4
|
"description": "把tailwindcss jit引擎,带给小程序开发者们! bring tailwindcss jit engine to miniprogram developers!",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
},
|
|
103
103
|
"homepage": "https://weapp-tw.icebreaker.top",
|
|
104
104
|
"devDependencies": {
|
|
105
|
-
"@babel/core": "^7.
|
|
105
|
+
"@babel/core": "^7.23.0",
|
|
106
106
|
"@icebreakers/cli": "0.1.1",
|
|
107
107
|
"@icebreakers/readme": "0.1.0",
|
|
108
108
|
"@rollup/plugin-alias": "^5.0.0",
|
|
@@ -110,40 +110,41 @@
|
|
|
110
110
|
"@rollup/plugin-json": "^6.0.0",
|
|
111
111
|
"@rollup/plugin-node-resolve": "^15.2.1",
|
|
112
112
|
"@rollup/plugin-terser": "^0.4.3",
|
|
113
|
-
"@rollup/plugin-typescript": "^11.1.
|
|
113
|
+
"@rollup/plugin-typescript": "^11.1.4",
|
|
114
114
|
"@tsconfig/recommended": "^1.0.3",
|
|
115
115
|
"@types/babel__generator": "^7.6.5",
|
|
116
116
|
"@types/babel__traverse": "^7.20.2",
|
|
117
|
-
"@types/debug": "^4.1.
|
|
118
|
-
"@types/diff": "^5.0.
|
|
117
|
+
"@types/debug": "^4.1.9",
|
|
118
|
+
"@types/diff": "^5.0.5",
|
|
119
119
|
"@types/fs-extra": "^11.0.2",
|
|
120
|
-
"@types/gulp": "^4.0.
|
|
121
|
-
"@types/gulp-postcss": "^8.0.
|
|
120
|
+
"@types/gulp": "^4.0.14",
|
|
121
|
+
"@types/gulp-postcss": "^8.0.4",
|
|
122
122
|
"@types/jest": "^29.5.5",
|
|
123
123
|
"@types/js-beautify": "^1.14.1",
|
|
124
124
|
"@types/klaw": "^3.0.4",
|
|
125
125
|
"@types/loader-utils": "^2.0.4",
|
|
126
|
-
"@types/lodash": "^4.14.
|
|
127
|
-
"@types/md5": "^2.3.
|
|
128
|
-
"@types/micromatch": "^4.0.
|
|
129
|
-
"@types/node": "^20.
|
|
130
|
-
"@types/semver": "^7.5.
|
|
131
|
-
"@types/vinyl": "^2.0.
|
|
132
|
-
"@types/webpack": "^5.28.
|
|
133
|
-
"@types/webpack-sources": "^3.2.
|
|
134
|
-
"@vitest/coverage-v8": "^0.34.
|
|
135
|
-
"autoprefixer": "^10.4.
|
|
126
|
+
"@types/lodash": "^4.14.199",
|
|
127
|
+
"@types/md5": "^2.3.3",
|
|
128
|
+
"@types/micromatch": "^4.0.3",
|
|
129
|
+
"@types/node": "^20.7.0",
|
|
130
|
+
"@types/semver": "^7.5.3",
|
|
131
|
+
"@types/vinyl": "^2.0.8",
|
|
132
|
+
"@types/webpack": "^5.28.3",
|
|
133
|
+
"@types/webpack-sources": "^3.2.1",
|
|
134
|
+
"@vitest/coverage-v8": "^0.34.5",
|
|
135
|
+
"autoprefixer": "^10.4.16",
|
|
136
136
|
"babel-loader": "^9.1.3",
|
|
137
137
|
"bumpp": "^9.2.0",
|
|
138
138
|
"colorette": "^2.0.20",
|
|
139
139
|
"cross-env": "^7.0.3",
|
|
140
140
|
"css-loader": "^6.8.1",
|
|
141
|
+
"css-to-tailwindcss-plugin": "^0.1.5",
|
|
141
142
|
"dedent": "^1.5.1",
|
|
142
143
|
"defu": "6.1.2",
|
|
143
144
|
"del": "^7.1.0",
|
|
144
145
|
"diff": "^5.1.0",
|
|
145
146
|
"domhandler": "^5.0.3",
|
|
146
|
-
"eslint": "8.
|
|
147
|
+
"eslint": "8.50.0",
|
|
147
148
|
"eslint-config-icebreaker": "^1.2.2",
|
|
148
149
|
"eslint-config-prettier": "^9.0.0",
|
|
149
150
|
"eslint-plugin-prettier": "^5.0.0",
|
|
@@ -165,8 +166,9 @@
|
|
|
165
166
|
"postcss-rem-to-responsive-pixel": "^5.1.3",
|
|
166
167
|
"prettier": "^3.0.3",
|
|
167
168
|
"promisify-loader-runner": "^1.0.0",
|
|
168
|
-
"rollup": "^3.29.
|
|
169
|
+
"rollup": "^3.29.3",
|
|
169
170
|
"rollup-plugin-visualizer": "^5.9.2",
|
|
171
|
+
"sass": "^1.68.0",
|
|
170
172
|
"style-loader": "^3.3.3",
|
|
171
173
|
"tailwind-children": "^0.5.0",
|
|
172
174
|
"tailwindcss": "^3.3.3",
|
|
@@ -179,19 +181,19 @@
|
|
|
179
181
|
"typescript-transform-paths": "^3.4.6",
|
|
180
182
|
"vinyl": "^3.0.0",
|
|
181
183
|
"vite": "^4.4.9",
|
|
182
|
-
"vitest": "^0.34.
|
|
184
|
+
"vitest": "^0.34.5",
|
|
183
185
|
"weapp-tailwindcss-children": "^0.1.0",
|
|
184
186
|
"webpack": "^5.88.2",
|
|
185
187
|
"webpack-build-utils": "^0.0.4"
|
|
186
188
|
},
|
|
187
189
|
"dependencies": {
|
|
188
190
|
"@ast-core/escape": "^1.0.1",
|
|
189
|
-
"@babel/generator": "^7.
|
|
190
|
-
"@babel/parser": "^7.
|
|
191
|
-
"@babel/traverse": "^7.
|
|
192
|
-
"@babel/types": "^7.
|
|
193
|
-
"@csstools/postcss-is-pseudo-class": "^4.0.
|
|
194
|
-
"@tailwindcss-mangle/shared": "^2.2.
|
|
191
|
+
"@babel/generator": "^7.23.0",
|
|
192
|
+
"@babel/parser": "^7.23.0",
|
|
193
|
+
"@babel/traverse": "^7.23.0",
|
|
194
|
+
"@babel/types": "^7.23.0",
|
|
195
|
+
"@csstools/postcss-is-pseudo-class": "^4.0.2",
|
|
196
|
+
"@tailwindcss-mangle/shared": "^2.2.2",
|
|
195
197
|
"@weapp-core/escape": "^2.0.0",
|
|
196
198
|
"@weapp-core/regex": "^1.0.1",
|
|
197
199
|
"debug": "^4.3.4",
|
|
@@ -201,10 +203,10 @@
|
|
|
201
203
|
"magic-string": "^0.30.3",
|
|
202
204
|
"md5": "^2.3.0",
|
|
203
205
|
"micromatch": "^4.0.5",
|
|
204
|
-
"postcss": "8.4.
|
|
206
|
+
"postcss": "8.4.30",
|
|
205
207
|
"postcss-selector-parser": "^6.0.13",
|
|
206
208
|
"semver": "^7.5.4",
|
|
207
|
-
"tailwindcss-patch": "^2.2.
|
|
209
|
+
"tailwindcss-patch": "^2.2.2"
|
|
208
210
|
},
|
|
209
211
|
"packageManager": "pnpm@8.7.4",
|
|
210
212
|
"engines": {
|
|
@@ -247,6 +249,8 @@
|
|
|
247
249
|
"ls:pack": "npm pack --dry-run",
|
|
248
250
|
"cli:patch": "node bin/weapp-tailwindcss.js patch",
|
|
249
251
|
"release": "bumpp",
|
|
252
|
+
"css-build": "css2plugin build css-plugin.css css-plugin-scss.scss --cwd test/fixtures/css",
|
|
253
|
+
"css-build-out": "css2plugin build css-plugin.css css-plugin-scss.scss --cwd test/fixtures/css --out tw-plugins",
|
|
250
254
|
"-------": "-----------",
|
|
251
255
|
"postinstall": "node bin/weapp-tailwindcss.js patch"
|
|
252
256
|
}
|