weapp-tailwindcss 3.3.7 → 3.4.0-alpha.1
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/dist/chunk-23B34GUU.js +126 -0
- package/dist/chunk-33GCHXV2.js +953 -0
- package/dist/chunk-556KTBON.js +31 -0
- package/dist/chunk-6Z776ZWK.js +43 -0
- package/dist/chunk-75EWCRQW.mjs +13 -0
- package/dist/chunk-76AXDOI5.js +173 -0
- package/dist/chunk-77FRX3XG.js +30 -0
- package/dist/chunk-AB467PG7.mjs +43 -0
- package/dist/chunk-D7TNNBED.js +95 -0
- package/dist/chunk-E7XGHGC7.mjs +62 -0
- package/dist/chunk-F7IR3ASC.mjs +152 -0
- package/dist/chunk-GUE4UCRJ.mjs +126 -0
- package/dist/chunk-H62TECOL.js +216 -0
- package/dist/chunk-HBQASQKY.js +13 -0
- package/dist/chunk-IOYI6MSW.mjs +533 -0
- package/dist/chunk-JMMU4NZL.mjs +173 -0
- package/dist/chunk-KR2M4GD3.mjs +953 -0
- package/dist/chunk-LYLCSEZ7.js +152 -0
- package/dist/chunk-NVFWRLOI.mjs +27 -0
- package/dist/chunk-ODCGCGWM.js +533 -0
- package/dist/chunk-ORMKM6ZA.mjs +30 -0
- package/dist/chunk-S2GPPMOJ.js +27 -0
- package/dist/chunk-SRLZU2YE.mjs +95 -0
- package/dist/chunk-U2UGOG3R.js +62 -0
- package/dist/chunk-VECXHWWG.mjs +31 -0
- package/dist/chunk-Z3EH2XYL.mjs +216 -0
- package/dist/cli.d.mts +2 -0
- package/dist/cli.d.ts +2 -1
- package/dist/cli.js +32 -51
- package/dist/cli.mjs +34 -46
- package/dist/core.d.mts +22 -0
- package/dist/core.d.ts +16 -2
- package/dist/core.js +43 -63
- package/dist/core.mjs +46 -62
- package/dist/css-macro/index.d.mts +18 -0
- package/dist/css-macro/index.d.ts +7 -4
- package/dist/css-macro/index.js +37 -34
- package/dist/css-macro/index.mjs +35 -28
- package/dist/css-macro/postcss.d.mts +7 -0
- package/dist/css-macro/postcss.d.ts +5 -3
- package/dist/css-macro/postcss.js +54 -45
- package/dist/css-macro/postcss.mjs +54 -45
- package/dist/defaults.d.mts +16 -0
- package/dist/defaults.d.ts +16 -2
- package/dist/defaults.js +6 -9
- package/dist/defaults.mjs +9 -4
- package/dist/gulp.d.mts +26 -0
- package/dist/gulp.d.ts +26 -1
- package/dist/gulp.js +12 -37
- package/dist/gulp.mjs +15 -32
- package/dist/index.d.mts +17 -0
- package/dist/index.d.ts +17 -4
- package/dist/index.js +23 -44
- package/dist/index.mjs +23 -34
- package/dist/postcss.d.mts +23 -0
- package/dist/postcss.d.ts +23 -1
- package/dist/postcss.js +10 -24
- package/dist/postcss.mjs +17 -8
- package/dist/replace.d.mts +19 -0
- package/dist/replace.d.ts +19 -3
- package/dist/replace.js +30 -50
- package/dist/replace.mjs +30 -26
- package/dist/types-DSNuiOhH.d.mts +519 -0
- package/dist/types-DSNuiOhH.d.ts +519 -0
- package/dist/vite.d.mts +22 -0
- package/dist/vite.d.ts +22 -1
- package/dist/vite.js +12 -35
- package/dist/vite.mjs +15 -30
- package/dist/weapp-tw-runtime-loader.d.mts +7 -0
- package/dist/{bundlers/webpack/loaders/weapp-tw-runtime-loader.d.ts → weapp-tw-runtime-loader.d.ts} +4 -2
- package/dist/weapp-tw-runtime-loader.js +12 -12
- package/dist/weapp-tw-runtime-loader.mjs +12 -8
- package/dist/webpack.d.mts +26 -0
- package/dist/webpack.d.ts +26 -1
- package/dist/webpack.js +12 -35
- package/dist/webpack.mjs +15 -30
- package/dist/webpack4.d.mts +27 -0
- package/dist/webpack4.d.ts +27 -1
- package/dist/webpack4.js +205 -192
- package/dist/webpack4.mjs +211 -189
- package/package.json +18 -19
- package/dist/babel/index.d.ts +0 -16
- package/dist/bundlers/gulp/index.d.ts +0 -8
- package/dist/bundlers/vite/index.d.ts +0 -3
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v4.d.ts +0 -8
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +0 -8
- package/dist/bundlers/webpack/index.d.ts +0 -1
- package/dist/cache/index.d.ts +0 -32
- package/dist/constants-CFM1J-h1.js +0 -42
- package/dist/constants-Dy2Dd3Fz.mjs +0 -36
- package/dist/constants.d.ts +0 -7
- package/dist/css-macro/constants.d.ts +0 -14
- package/dist/debug/index.d.ts +0 -2
- package/dist/defaults-DUZZvtdg.mjs +0 -149
- package/dist/defaults-syv_N3uk.js +0 -156
- package/dist/defu-Cdz2PomB.js +0 -60
- package/dist/defu-n46TJT6t.mjs +0 -57
- package/dist/env.d.ts +0 -2
- package/dist/escape.d.ts +0 -4
- package/dist/extractors/split.d.ts +0 -3
- package/dist/index-B8TOcVAt.js +0 -130
- package/dist/index-BEIjgKpF.mjs +0 -11
- package/dist/index-BKZH-Gxq.mjs +0 -134
- package/dist/index-BPzIdybK.mjs +0 -513
- package/dist/index-Bc61v7B0.mjs +0 -124
- package/dist/index-DXeB6ex8.js +0 -136
- package/dist/index-DwZHOkK3.js +0 -526
- package/dist/index-HC-Qkn0i.js +0 -17
- package/dist/js/handlers.d.ts +0 -13
- package/dist/js/index.d.ts +0 -7
- package/dist/mangle/index.d.ts +0 -8
- package/dist/options-BHJnjA_a.mjs +0 -981
- package/dist/options-DAp5AdGz.js +0 -1014
- package/dist/options.d.ts +0 -2
- package/dist/postcss/cssVars.d.ts +0 -5
- package/dist/postcss/index.d.ts +0 -3
- package/dist/postcss/mp.d.ts +0 -8
- package/dist/postcss/plugins/ctx.d.ts +0 -6
- package/dist/postcss/plugins/index.d.ts +0 -7
- package/dist/postcss/plugins/post.d.ts +0 -5
- package/dist/postcss/plugins/pre.d.ts +0 -5
- package/dist/postcss/preflight.d.ts +0 -3
- package/dist/postcss/selectorParser.d.ts +0 -6
- package/dist/postcss/shared.d.ts +0 -3
- package/dist/postcss/symbols.d.ts +0 -1
- package/dist/reg.d.ts +0 -1
- package/dist/shared-DbJl6i6a.mjs +0 -25
- package/dist/shared-hzYeE1wX.js +0 -28
- package/dist/tailwindcss/patcher.d.ts +0 -8
- package/dist/tailwindcss/supportCustomUnit.d.ts +0 -6
- package/dist/types.d.ts +0 -179
- package/dist/utils.d.ts +0 -18
- package/dist/v5-B9S3lBOs.mjs +0 -174
- package/dist/v5-QURRYPNk.js +0 -181
- package/dist/wxml/Tokenizer.d.ts +0 -31
- package/dist/wxml/index.d.ts +0 -2
- package/dist/wxml/shared.d.ts +0 -2
- package/dist/wxml/utils.d.ts +0 -9
package/dist/webpack4.mjs
CHANGED
|
@@ -1,194 +1,216 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import 'semver';
|
|
22
|
-
import 'tailwindcss-patch';
|
|
23
|
-
import '@tailwindcss-mangle/shared';
|
|
24
|
-
import 'lru-cache';
|
|
25
|
-
import 'md5';
|
|
26
|
-
import '@csstools/postcss-is-pseudo-class';
|
|
27
|
-
import 'postcss-rem-to-responsive-pixel';
|
|
28
|
-
import 'postcss-selector-parser';
|
|
29
|
-
import './defu-n46TJT6t.mjs';
|
|
30
|
-
import 'debug';
|
|
1
|
+
import {
|
|
2
|
+
createDebug
|
|
3
|
+
} from "./chunk-75EWCRQW.mjs";
|
|
4
|
+
import {
|
|
5
|
+
getOptions
|
|
6
|
+
} from "./chunk-KR2M4GD3.mjs";
|
|
7
|
+
import "./chunk-SRLZU2YE.mjs";
|
|
8
|
+
import {
|
|
9
|
+
getGroupedEntries,
|
|
10
|
+
removeExt
|
|
11
|
+
} from "./chunk-GUE4UCRJ.mjs";
|
|
12
|
+
import {
|
|
13
|
+
pluginName
|
|
14
|
+
} from "./chunk-IOYI6MSW.mjs";
|
|
15
|
+
import "./chunk-NVFWRLOI.mjs";
|
|
16
|
+
import "./chunk-ORMKM6ZA.mjs";
|
|
17
|
+
import "./chunk-VECXHWWG.mjs";
|
|
18
|
+
import {
|
|
19
|
+
__async
|
|
20
|
+
} from "./chunk-E7XGHGC7.mjs";
|
|
31
21
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
22
|
+
// src/bundlers/webpack/BaseUnifiedPlugin/v4.ts
|
|
23
|
+
import path from "path";
|
|
24
|
+
import fs from "fs";
|
|
25
|
+
import { ConcatSource, RawSource } from "webpack-sources";
|
|
26
|
+
var debug = createDebug();
|
|
27
|
+
var UnifiedWebpackPluginV4 = class {
|
|
28
|
+
constructor(options = {}) {
|
|
29
|
+
this.options = getOptions(options);
|
|
30
|
+
this.appType = this.options.appType;
|
|
31
|
+
}
|
|
32
|
+
apply(compiler) {
|
|
33
|
+
const {
|
|
34
|
+
mainCssChunkMatcher,
|
|
35
|
+
disabled,
|
|
36
|
+
onLoad,
|
|
37
|
+
onUpdate,
|
|
38
|
+
onEnd,
|
|
39
|
+
onStart,
|
|
40
|
+
styleHandler,
|
|
41
|
+
patch,
|
|
42
|
+
templateHandler,
|
|
43
|
+
jsHandler,
|
|
44
|
+
setMangleRuntimeSet,
|
|
45
|
+
runtimeLoaderPath,
|
|
46
|
+
cache,
|
|
47
|
+
twPatcher
|
|
48
|
+
} = this.options;
|
|
49
|
+
if (disabled) {
|
|
50
|
+
return;
|
|
37
51
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
52
|
+
patch == null ? void 0 : patch();
|
|
53
|
+
function getClassSet() {
|
|
54
|
+
return twPatcher.getClassSet();
|
|
55
|
+
}
|
|
56
|
+
onLoad();
|
|
57
|
+
const loader = runtimeLoaderPath != null ? runtimeLoaderPath : path.resolve(__dirname, "./weapp-tw-runtime-loader.js");
|
|
58
|
+
const isExisted = fs.existsSync(loader);
|
|
59
|
+
const WeappTwRuntimeAopLoader = {
|
|
60
|
+
loader,
|
|
61
|
+
options: {
|
|
62
|
+
getClassSet
|
|
63
|
+
},
|
|
64
|
+
ident: null,
|
|
65
|
+
type: null
|
|
66
|
+
};
|
|
67
|
+
compiler.hooks.compilation.tap(pluginName, (compilation) => {
|
|
68
|
+
compilation.hooks.normalModuleLoader.tap(pluginName, (_loaderContext, module) => {
|
|
69
|
+
if (isExisted) {
|
|
70
|
+
const idx = module.loaders.findIndex((x) => x.loader.includes("postcss-loader"));
|
|
71
|
+
if (idx > -1) {
|
|
72
|
+
module.loaders.unshift(WeappTwRuntimeAopLoader);
|
|
73
|
+
}
|
|
42
74
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
compiler.hooks.emit.tapPromise(pluginName, (compilation) => __async(this, null, function* () {
|
|
78
|
+
onStart();
|
|
79
|
+
debug("start");
|
|
80
|
+
for (const chunk of compilation.chunks) {
|
|
81
|
+
if (chunk.id && chunk.hash) {
|
|
82
|
+
cache.calcHashValueChanged(chunk.id, chunk.hash);
|
|
46
83
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
84
|
+
}
|
|
85
|
+
const assets = compilation.assets;
|
|
86
|
+
const entries = Object.entries(assets);
|
|
87
|
+
const groupedEntries = getGroupedEntries(entries, this.options);
|
|
88
|
+
const runtimeSet = getClassSet();
|
|
89
|
+
setMangleRuntimeSet(runtimeSet);
|
|
90
|
+
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
91
|
+
if (Array.isArray(groupedEntries.html)) {
|
|
92
|
+
let noCachedCount = 0;
|
|
93
|
+
for (let i = 0; i < groupedEntries.html.length; i++) {
|
|
94
|
+
const [file, originalSource] = groupedEntries.html[i];
|
|
95
|
+
const rawSource = originalSource.source().toString();
|
|
96
|
+
const hash = cache.computeHash(rawSource);
|
|
97
|
+
const cacheKey = file;
|
|
98
|
+
cache.calcHashValueChanged(cacheKey, hash);
|
|
99
|
+
yield cache.process(
|
|
100
|
+
cacheKey,
|
|
101
|
+
() => {
|
|
102
|
+
const source = cache.get(cacheKey);
|
|
103
|
+
if (source) {
|
|
104
|
+
compilation.updateAsset(file, source);
|
|
105
|
+
debug("html cache hit: %s", file);
|
|
106
|
+
} else {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
54
109
|
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
yield cache.process(cacheKey, () => {
|
|
163
|
-
const source = cache.get(cacheKey);
|
|
164
|
-
if (source) {
|
|
165
|
-
compilation.updateAsset(file, source);
|
|
166
|
-
debug('css cache hit: %s', file);
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
return false;
|
|
170
|
-
}
|
|
171
|
-
}, () => __awaiter(this, void 0, void 0, function* () {
|
|
172
|
-
const css = yield styleHandler(rawSource, {
|
|
173
|
-
isMainChunk: mainCssChunkMatcher(file, this.appType),
|
|
174
|
-
});
|
|
175
|
-
const source = new ConcatSource(css);
|
|
176
|
-
compilation.updateAsset(file, source);
|
|
177
|
-
onUpdate(file, rawSource, css);
|
|
178
|
-
debug('css handle: %s', file);
|
|
179
|
-
noCachedCount++;
|
|
180
|
-
return {
|
|
181
|
-
key: cacheKey,
|
|
182
|
-
source,
|
|
183
|
-
};
|
|
184
|
-
}));
|
|
185
|
-
}
|
|
186
|
-
debug('css handle finish, total: %d, no-cached: %d', groupedEntries.css.length, noCachedCount);
|
|
187
|
-
}
|
|
188
|
-
debug('end');
|
|
189
|
-
onEnd();
|
|
190
|
-
}));
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export { UnifiedWebpackPluginV4 };
|
|
110
|
+
// @ts-ignore
|
|
111
|
+
() => __async(this, null, function* () {
|
|
112
|
+
const wxml = yield templateHandler(rawSource, {
|
|
113
|
+
runtimeSet
|
|
114
|
+
});
|
|
115
|
+
const source = new ConcatSource(wxml);
|
|
116
|
+
compilation.updateAsset(file, source);
|
|
117
|
+
onUpdate(file, rawSource, wxml);
|
|
118
|
+
debug("html handle: %s", file);
|
|
119
|
+
noCachedCount++;
|
|
120
|
+
return {
|
|
121
|
+
key: cacheKey,
|
|
122
|
+
source
|
|
123
|
+
};
|
|
124
|
+
})
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
debug("html handle finish, total: %d, no-cached: %d", groupedEntries.html.length, noCachedCount);
|
|
128
|
+
}
|
|
129
|
+
if (Array.isArray(groupedEntries.js)) {
|
|
130
|
+
let noCachedCount = 0;
|
|
131
|
+
for (let i = 0; i < groupedEntries.js.length; i++) {
|
|
132
|
+
const [file, originalSource] = groupedEntries.js[i];
|
|
133
|
+
const cacheKey = removeExt(file);
|
|
134
|
+
yield cache.process(
|
|
135
|
+
cacheKey,
|
|
136
|
+
() => {
|
|
137
|
+
const source = cache.get(cacheKey);
|
|
138
|
+
if (source) {
|
|
139
|
+
compilation.updateAsset(file, source);
|
|
140
|
+
debug("js cache hit: %s", file);
|
|
141
|
+
} else {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
// @ts-ignore
|
|
146
|
+
() => __async(this, null, function* () {
|
|
147
|
+
const rawSource = originalSource.source().toString();
|
|
148
|
+
const mapFilename = `${file}.map`;
|
|
149
|
+
const hasMap = Boolean(assets[mapFilename]);
|
|
150
|
+
const { code, map } = yield jsHandler(rawSource, runtimeSet, {
|
|
151
|
+
generateMap: hasMap
|
|
152
|
+
});
|
|
153
|
+
const source = new ConcatSource(code);
|
|
154
|
+
compilation.updateAsset(file, source);
|
|
155
|
+
onUpdate(file, rawSource, code);
|
|
156
|
+
debug("js handle: %s", file);
|
|
157
|
+
noCachedCount++;
|
|
158
|
+
if (hasMap && map) {
|
|
159
|
+
const source2 = new RawSource(map.toString());
|
|
160
|
+
compilation.updateAsset(mapFilename, source2);
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
key: cacheKey,
|
|
164
|
+
source
|
|
165
|
+
};
|
|
166
|
+
})
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
debug("js handle finish, total: %d, no-cached: %d", groupedEntries.js.length, noCachedCount);
|
|
170
|
+
}
|
|
171
|
+
if (Array.isArray(groupedEntries.css)) {
|
|
172
|
+
let noCachedCount = 0;
|
|
173
|
+
for (let i = 0; i < groupedEntries.css.length; i++) {
|
|
174
|
+
const [file, originalSource] = groupedEntries.css[i];
|
|
175
|
+
const rawSource = originalSource.source().toString();
|
|
176
|
+
const hash = cache.computeHash(rawSource);
|
|
177
|
+
const cacheKey = file;
|
|
178
|
+
cache.calcHashValueChanged(cacheKey, hash);
|
|
179
|
+
yield cache.process(
|
|
180
|
+
cacheKey,
|
|
181
|
+
() => {
|
|
182
|
+
const source = cache.get(cacheKey);
|
|
183
|
+
if (source) {
|
|
184
|
+
compilation.updateAsset(file, source);
|
|
185
|
+
debug("css cache hit: %s", file);
|
|
186
|
+
} else {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
// @ts-ignore
|
|
191
|
+
() => __async(this, null, function* () {
|
|
192
|
+
const css = yield styleHandler(rawSource, {
|
|
193
|
+
isMainChunk: mainCssChunkMatcher(file, this.appType)
|
|
194
|
+
});
|
|
195
|
+
const source = new ConcatSource(css);
|
|
196
|
+
compilation.updateAsset(file, source);
|
|
197
|
+
onUpdate(file, rawSource, css);
|
|
198
|
+
debug("css handle: %s", file);
|
|
199
|
+
noCachedCount++;
|
|
200
|
+
return {
|
|
201
|
+
key: cacheKey,
|
|
202
|
+
source
|
|
203
|
+
};
|
|
204
|
+
})
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
debug("css handle finish, total: %d, no-cached: %d", groupedEntries.css.length, noCachedCount);
|
|
208
|
+
}
|
|
209
|
+
debug("end");
|
|
210
|
+
onEnd();
|
|
211
|
+
}));
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
export {
|
|
215
|
+
UnifiedWebpackPluginV4
|
|
216
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0-alpha.1",
|
|
4
4
|
"description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
|
|
5
5
|
"author": "SonOfMagic <qq1324318532@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -125,31 +125,31 @@
|
|
|
125
125
|
"registry": "https://registry.npmjs.org"
|
|
126
126
|
},
|
|
127
127
|
"dependencies": {
|
|
128
|
-
"@ast-core/escape": "
|
|
129
|
-
"@babel/generator": "7.24.
|
|
130
|
-
"@babel/parser": "7.24.
|
|
131
|
-
"@babel/traverse": "7.24.
|
|
132
|
-
"@babel/types": "7.24.
|
|
133
|
-
"@csstools/postcss-is-pseudo-class": "4.0.8",
|
|
134
|
-
"@tailwindcss-mangle/shared": "
|
|
135
|
-
"@weapp-core/escape": "
|
|
136
|
-
"@weapp-core/regex": "
|
|
137
|
-
"debug": "4.3.5",
|
|
128
|
+
"@ast-core/escape": "~1.0.1",
|
|
129
|
+
"@babel/generator": "~7.24.8",
|
|
130
|
+
"@babel/parser": "~7.24.8",
|
|
131
|
+
"@babel/traverse": "~7.24.8",
|
|
132
|
+
"@babel/types": "~7.24.8",
|
|
133
|
+
"@csstools/postcss-is-pseudo-class": "~4.0.8",
|
|
134
|
+
"@tailwindcss-mangle/shared": "~3.0.0",
|
|
135
|
+
"@weapp-core/escape": "~2.1.0",
|
|
136
|
+
"@weapp-core/regex": "~1.0.1",
|
|
137
|
+
"debug": "~4.3.5",
|
|
138
138
|
"htmlparser2": "9.1.0",
|
|
139
139
|
"loader-utils": "2.0.4",
|
|
140
140
|
"lru-cache": "10.4.3",
|
|
141
141
|
"magic-string": "0.30.10",
|
|
142
142
|
"md5": "2.3.0",
|
|
143
|
-
"postcss": "8.4.39",
|
|
144
|
-
"postcss-rem-to-responsive-pixel": "
|
|
145
|
-
"postcss-selector-parser": "6.1.
|
|
146
|
-
"semver": "7.6.2",
|
|
147
|
-
"tailwindcss-patch": "
|
|
143
|
+
"postcss": "~8.4.39",
|
|
144
|
+
"postcss-rem-to-responsive-pixel": "~6.0.1",
|
|
145
|
+
"postcss-selector-parser": "~6.1.1",
|
|
146
|
+
"semver": "~7.6.2",
|
|
147
|
+
"tailwindcss-patch": "4.0.0-alpha.1",
|
|
148
148
|
"webpack-sources": "3.2.3"
|
|
149
149
|
},
|
|
150
150
|
"scripts": {
|
|
151
|
-
"dev": "
|
|
152
|
-
"build": "pnpm clean &&
|
|
151
|
+
"dev": "tsup --watch --sourcemap",
|
|
152
|
+
"build": "pnpm clean && tsup",
|
|
153
153
|
"build:tsc": "cross-env NODE_ENV=development tsc --build tsconfig.json",
|
|
154
154
|
"build:cli": "cd plugins/cli && pnpm run build",
|
|
155
155
|
"dts": "tsc --emitDeclarationOnly -p tsconfig.dts.json",
|
|
@@ -162,7 +162,6 @@
|
|
|
162
162
|
"sync": "cnpm sync weapp-tailwindcss-webpack-plugin weapp-tailwindcss weapp-tw",
|
|
163
163
|
"ls:pack": "npm pack --dry-run",
|
|
164
164
|
"cli:patch": "node bin/weapp-tailwindcss.js patch",
|
|
165
|
-
"bump": "bumpp",
|
|
166
165
|
"release": "node scripts/release.js",
|
|
167
166
|
"generate:readme": "tsx scripts/readme/write.ts",
|
|
168
167
|
"lint": "eslint .",
|
package/dist/babel/index.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import _babelGenerate from '@babel/generator';
|
|
2
|
-
export { parse, parseExpression } from '@babel/parser';
|
|
3
|
-
export declare const generate: typeof _babelGenerate;
|
|
4
|
-
export declare const traverse: {
|
|
5
|
-
<S>(parent: import("@babel/types").Node, opts: import("@babel/traverse").TraverseOptions<S>, scope: import("@babel/traverse").Scope | undefined, state: S, parentPath?: import("@babel/traverse").NodePath<import("@babel/types").Node> | undefined): void;
|
|
6
|
-
(parent: import("@babel/types").Node, opts?: import("@babel/traverse").TraverseOptions<import("@babel/types").Node> | undefined, scope?: import("@babel/traverse").Scope | undefined, state?: any, parentPath?: import("@babel/traverse").NodePath<import("@babel/types").Node> | undefined): void;
|
|
7
|
-
visitors: typeof import("@babel/traverse").visitors;
|
|
8
|
-
verify: typeof import("@babel/traverse").visitors.verify;
|
|
9
|
-
explode: typeof import("@babel/traverse").visitors.explode;
|
|
10
|
-
cheap: (node: import("@babel/types").Node, enter: (node: import("@babel/types").Node) => void) => void;
|
|
11
|
-
node: (node: import("@babel/types").Node, opts: import("@babel/traverse").TraverseOptions<import("@babel/types").Node>, scope?: import("@babel/traverse").Scope | undefined, state?: any, path?: import("@babel/traverse").NodePath<import("@babel/types").Node> | undefined, skipKeys?: Record<string, boolean> | undefined) => void;
|
|
12
|
-
clearNode: (node: import("@babel/types").Node, opts?: import("@babel/types").RemovePropertiesOptions | undefined) => void;
|
|
13
|
-
removeProperties: (tree: import("@babel/types").Node, opts?: import("@babel/types").RemovePropertiesOptions | undefined) => import("@babel/types").Node;
|
|
14
|
-
hasType: (tree: import("@babel/types").Node, type: "AnyTypeAnnotation" | "ArgumentPlaceholder" | "ArrayExpression" | "ArrayPattern" | "ArrayTypeAnnotation" | "ArrowFunctionExpression" | "AssignmentExpression" | "AssignmentPattern" | "AwaitExpression" | "BigIntLiteral" | "BinaryExpression" | "BindExpression" | "BlockStatement" | "BooleanLiteral" | "BooleanLiteralTypeAnnotation" | "BooleanTypeAnnotation" | "BreakStatement" | "CallExpression" | "CatchClause" | "ClassAccessorProperty" | "ClassBody" | "ClassDeclaration" | "ClassExpression" | "ClassImplements" | "ClassMethod" | "ClassPrivateMethod" | "ClassPrivateProperty" | "ClassProperty" | "ConditionalExpression" | "ContinueStatement" | "DebuggerStatement" | "DecimalLiteral" | "DeclareClass" | "DeclareExportAllDeclaration" | "DeclareExportDeclaration" | "DeclareFunction" | "DeclareInterface" | "DeclareModule" | "DeclareModuleExports" | "DeclareOpaqueType" | "DeclareTypeAlias" | "DeclareVariable" | "DeclaredPredicate" | "Decorator" | "Directive" | "DirectiveLiteral" | "DoExpression" | "DoWhileStatement" | "EmptyStatement" | "EmptyTypeAnnotation" | "EnumBooleanBody" | "EnumBooleanMember" | "EnumDeclaration" | "EnumDefaultedMember" | "EnumNumberBody" | "EnumNumberMember" | "EnumStringBody" | "EnumStringMember" | "EnumSymbolBody" | "ExistsTypeAnnotation" | "ExportAllDeclaration" | "ExportDefaultDeclaration" | "ExportDefaultSpecifier" | "ExportNamedDeclaration" | "ExportNamespaceSpecifier" | "ExportSpecifier" | "ExpressionStatement" | "File" | "ForInStatement" | "ForOfStatement" | "ForStatement" | "FunctionDeclaration" | "FunctionExpression" | "FunctionTypeAnnotation" | "FunctionTypeParam" | "GenericTypeAnnotation" | "Identifier" | "IfStatement" | "Import" | "ImportAttribute" | "ImportDeclaration" | "ImportDefaultSpecifier" | "ImportExpression" | "ImportNamespaceSpecifier" | "ImportSpecifier" | "IndexedAccessType" | "InferredPredicate" | "InterfaceDeclaration" | "InterfaceExtends" | "InterfaceTypeAnnotation" | "InterpreterDirective" | "IntersectionTypeAnnotation" | "JSXAttribute" | "JSXClosingElement" | "JSXClosingFragment" | "JSXElement" | "JSXEmptyExpression" | "JSXExpressionContainer" | "JSXFragment" | "JSXIdentifier" | "JSXMemberExpression" | "JSXNamespacedName" | "JSXOpeningElement" | "JSXOpeningFragment" | "JSXSpreadAttribute" | "JSXSpreadChild" | "JSXText" | "LabeledStatement" | "LogicalExpression" | "MemberExpression" | "MetaProperty" | "MixedTypeAnnotation" | "ModuleExpression" | "NewExpression" | "Noop" | "NullLiteral" | "NullLiteralTypeAnnotation" | "NullableTypeAnnotation" | "NumberLiteral" | "NumberLiteralTypeAnnotation" | "NumberTypeAnnotation" | "NumericLiteral" | "ObjectExpression" | "ObjectMethod" | "ObjectPattern" | "ObjectProperty" | "ObjectTypeAnnotation" | "ObjectTypeCallProperty" | "ObjectTypeIndexer" | "ObjectTypeInternalSlot" | "ObjectTypeProperty" | "ObjectTypeSpreadProperty" | "OpaqueType" | "OptionalCallExpression" | "OptionalIndexedAccessType" | "OptionalMemberExpression" | "ParenthesizedExpression" | "PipelineBareFunction" | "PipelinePrimaryTopicReference" | "PipelineTopicExpression" | "Placeholder" | "PrivateName" | "Program" | "QualifiedTypeIdentifier" | "RecordExpression" | "RegExpLiteral" | "RegexLiteral" | "RestElement" | "RestProperty" | "ReturnStatement" | "SequenceExpression" | "SpreadElement" | "SpreadProperty" | "StaticBlock" | "StringLiteral" | "StringLiteralTypeAnnotation" | "StringTypeAnnotation" | "Super" | "SwitchCase" | "SwitchStatement" | "SymbolTypeAnnotation" | "TSAnyKeyword" | "TSArrayType" | "TSAsExpression" | "TSBigIntKeyword" | "TSBooleanKeyword" | "TSCallSignatureDeclaration" | "TSConditionalType" | "TSConstructSignatureDeclaration" | "TSConstructorType" | "TSDeclareFunction" | "TSDeclareMethod" | "TSEnumDeclaration" | "TSEnumMember" | "TSExportAssignment" | "TSExpressionWithTypeArguments" | "TSExternalModuleReference" | "TSFunctionType" | "TSImportEqualsDeclaration" | "TSImportType" | "TSIndexSignature" | "TSIndexedAccessType" | "TSInferType" | "TSInstantiationExpression" | "TSInterfaceBody" | "TSInterfaceDeclaration" | "TSIntersectionType" | "TSIntrinsicKeyword" | "TSLiteralType" | "TSMappedType" | "TSMethodSignature" | "TSModuleBlock" | "TSModuleDeclaration" | "TSNamedTupleMember" | "TSNamespaceExportDeclaration" | "TSNeverKeyword" | "TSNonNullExpression" | "TSNullKeyword" | "TSNumberKeyword" | "TSObjectKeyword" | "TSOptionalType" | "TSParameterProperty" | "TSParenthesizedType" | "TSPropertySignature" | "TSQualifiedName" | "TSRestType" | "TSSatisfiesExpression" | "TSStringKeyword" | "TSSymbolKeyword" | "TSThisType" | "TSTupleType" | "TSTypeAliasDeclaration" | "TSTypeAnnotation" | "TSTypeAssertion" | "TSTypeLiteral" | "TSTypeOperator" | "TSTypeParameter" | "TSTypeParameterDeclaration" | "TSTypeParameterInstantiation" | "TSTypePredicate" | "TSTypeQuery" | "TSTypeReference" | "TSUndefinedKeyword" | "TSUnionType" | "TSUnknownKeyword" | "TSVoidKeyword" | "TaggedTemplateExpression" | "TemplateElement" | "TemplateLiteral" | "ThisExpression" | "ThisTypeAnnotation" | "ThrowStatement" | "TopicReference" | "TryStatement" | "TupleExpression" | "TupleTypeAnnotation" | "TypeAlias" | "TypeAnnotation" | "TypeCastExpression" | "TypeParameter" | "TypeParameterDeclaration" | "TypeParameterInstantiation" | "TypeofTypeAnnotation" | "UnaryExpression" | "UnionTypeAnnotation" | "UpdateExpression" | "V8IntrinsicIdentifier" | "VariableDeclaration" | "VariableDeclarator" | "Variance" | "VoidTypeAnnotation" | "WhileStatement" | "WithStatement" | "YieldExpression", denylistTypes?: string[] | undefined) => boolean;
|
|
15
|
-
cache: typeof import("@babel/traverse").cache;
|
|
16
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import stream from 'node:stream';
|
|
3
|
-
import type { CreateJsHandlerOptions, IStyleHandlerOptions, ITemplateHandlerOptions, UserDefinedOptions } from "../../types";
|
|
4
|
-
export declare function createPlugins(options?: UserDefinedOptions): {
|
|
5
|
-
transformWxss: (options?: Partial<IStyleHandlerOptions>) => stream.Transform;
|
|
6
|
-
transformWxml: (options?: Partial<ITemplateHandlerOptions>) => stream.Transform;
|
|
7
|
-
transformJs: (options?: Partial<CreateJsHandlerOptions>) => stream.Transform;
|
|
8
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Compiler } from 'webpack4';
|
|
2
|
-
import type { AppType, IBaseWebpackPlugin, InternalUserDefinedOptions, UserDefinedOptions } from "../../../types";
|
|
3
|
-
export declare class UnifiedWebpackPluginV4 implements IBaseWebpackPlugin {
|
|
4
|
-
options: InternalUserDefinedOptions;
|
|
5
|
-
appType?: AppType;
|
|
6
|
-
constructor(options?: UserDefinedOptions);
|
|
7
|
-
apply(compiler: Compiler): void;
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Compiler } from 'webpack';
|
|
2
|
-
import type { AppType, IBaseWebpackPlugin, InternalUserDefinedOptions, UserDefinedOptions } from "../../../types";
|
|
3
|
-
export declare class UnifiedWebpackPluginV5 implements IBaseWebpackPlugin {
|
|
4
|
-
options: InternalUserDefinedOptions;
|
|
5
|
-
appType?: AppType;
|
|
6
|
-
constructor(options?: UserDefinedOptions);
|
|
7
|
-
apply(compiler: Compiler): void;
|
|
8
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './BaseUnifiedPlugin/v5';
|
package/dist/cache/index.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import type { Buffer } from 'node:buffer';
|
|
3
|
-
import { LRUCache } from 'lru-cache';
|
|
4
|
-
import type { sources } from 'webpack';
|
|
5
|
-
export interface HashMapValue {
|
|
6
|
-
hash: string;
|
|
7
|
-
changed: boolean;
|
|
8
|
-
}
|
|
9
|
-
export type HashMapKey = string | number;
|
|
10
|
-
export type CacheValue = sources.Source | string;
|
|
11
|
-
export interface ICreateCacheReturnType {
|
|
12
|
-
hashMap: Map<HashMapKey, HashMapValue>;
|
|
13
|
-
instance: LRUCache<string, CacheValue>;
|
|
14
|
-
hasHashKey: (key: HashMapKey) => boolean;
|
|
15
|
-
getHashValue: (key: HashMapKey) => HashMapValue | undefined;
|
|
16
|
-
setHashValue: (key: HashMapKey, value: HashMapValue) => this['hashMap'];
|
|
17
|
-
computeHash: (message: string | Buffer) => string;
|
|
18
|
-
get: <V extends CacheValue = sources.Source>(key: string) => V | undefined;
|
|
19
|
-
set: <V extends CacheValue = sources.Source>(key: string, value: V) => this['instance'];
|
|
20
|
-
has: (key: string) => boolean;
|
|
21
|
-
calcHashValueChanged: (key: HashMapKey, hash: string) => this;
|
|
22
|
-
process: (key: string, callback: () => void | false | Promise<void | false>, fallback: () => void | {
|
|
23
|
-
key: string;
|
|
24
|
-
source: CacheValue;
|
|
25
|
-
} | Promise<void | {
|
|
26
|
-
key: string;
|
|
27
|
-
source: CacheValue;
|
|
28
|
-
}>) => void | Promise<void>;
|
|
29
|
-
}
|
|
30
|
-
export type ICreateCacheOptions = boolean;
|
|
31
|
-
declare function createCache(options?: ICreateCacheOptions): ICreateCacheReturnType;
|
|
32
|
-
export { createCache };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const queryKey = 'weapp-tw-platform';
|
|
4
|
-
function createMediaQuery(value) {
|
|
5
|
-
return `@media (${queryKey}:"${value}"){&}`;
|
|
6
|
-
}
|
|
7
|
-
function createNegativeMediaQuery(value) {
|
|
8
|
-
return `@media not screen and (${queryKey}:"${value}"){&}`;
|
|
9
|
-
}
|
|
10
|
-
function normalComment(text) {
|
|
11
|
-
if (typeof text === 'string') {
|
|
12
|
-
return text.replaceAll(/(?<!\\)_/g, ' ');
|
|
13
|
-
}
|
|
14
|
-
return text;
|
|
15
|
-
}
|
|
16
|
-
function ifdef(text) {
|
|
17
|
-
return {
|
|
18
|
-
start: `#ifdef ${normalComment(text)}`,
|
|
19
|
-
end: `#endif`,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
function ifndef(text) {
|
|
23
|
-
return {
|
|
24
|
-
start: `#ifndef ${normalComment(text)}`,
|
|
25
|
-
end: `#endif`,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
function matchCustomPropertyFromValue(str, cb) {
|
|
29
|
-
let arr;
|
|
30
|
-
let index = 0;
|
|
31
|
-
const regex = new RegExp(`\\(\\s*${queryKey}\\s*:\\s*"([^)]*)"\\)`, 'g');
|
|
32
|
-
while ((arr = regex.exec(str)) !== null) {
|
|
33
|
-
cb(arr, index);
|
|
34
|
-
index++;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
exports.createMediaQuery = createMediaQuery;
|
|
39
|
-
exports.createNegativeMediaQuery = createNegativeMediaQuery;
|
|
40
|
-
exports.ifdef = ifdef;
|
|
41
|
-
exports.ifndef = ifndef;
|
|
42
|
-
exports.matchCustomPropertyFromValue = matchCustomPropertyFromValue;
|