weapp-tailwindcss 4.9.8 → 4.9.9-beta.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.
- package/dist/{chunk-OW5UKXZU.js → chunk-42HSNAKM.js} +3 -3
- package/dist/{chunk-BJWGT5OD.js → chunk-A2ST4H4Y.js} +3 -3
- package/dist/{chunk-Z545JGD6.js → chunk-CAFL5XBF.js} +24 -24
- package/dist/{chunk-N75TUIFJ.mjs → chunk-FT3YGOHE.mjs} +422 -66
- package/dist/{chunk-YJDEI6WM.js → chunk-HQ2G6NBK.js} +434 -78
- package/dist/{chunk-M27GDCY2.mjs → chunk-IY5ZVBL2.mjs} +1 -1
- package/dist/{chunk-W3JRVMJD.mjs → chunk-NBS6RMNM.mjs} +1 -1
- package/dist/{chunk-WJVKUHYW.js → chunk-U4T2HGRZ.js} +7 -7
- package/dist/{chunk-RGMNU44M.mjs → chunk-YPIQUBC4.mjs} +3 -3
- package/dist/{chunk-CKEQFURT.mjs → chunk-YVYWSXU7.mjs} +2 -2
- package/dist/{chunk-EAD4D7DF.js → chunk-YY55J7K3.js} +74 -61
- package/dist/{chunk-77PO4QLM.mjs → chunk-YYE3U4L3.mjs} +19 -6
- package/dist/cli.js +9 -9
- package/dist/cli.mjs +1 -1
- package/dist/core.js +8 -8
- package/dist/core.mjs +2 -2
- package/dist/gulp.js +4 -4
- package/dist/gulp.mjs +3 -3
- package/dist/index.js +7 -7
- package/dist/index.mjs +6 -6
- package/dist/vite.js +4 -4
- package/dist/vite.mjs +3 -3
- package/dist/webpack.js +5 -5
- package/dist/webpack.mjs +4 -4
- package/dist/webpack4.js +24 -24
- package/dist/webpack4.mjs +3 -3
- package/package.json +7 -4
|
@@ -45,6 +45,10 @@ function getTailwindConfigSignature(twPatcher) {
|
|
|
45
45
|
return `${configPath}:missing`;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
+
function getPatchTargetSignature(twPatcher) {
|
|
49
|
+
const packageInfo = twPatcher.packageInfo;
|
|
50
|
+
return `${packageInfo?.rootPath ?? "missing"}:${packageInfo?.version ?? "unknown"}:${twPatcher.majorVersion ?? "unknown"}`;
|
|
51
|
+
}
|
|
48
52
|
function invalidateRuntimeClassSet(twPatcher) {
|
|
49
53
|
if (!twPatcher) {
|
|
50
54
|
return;
|
|
@@ -55,7 +59,9 @@ function getRuntimeClassSetCacheEntry(twPatcher) {
|
|
|
55
59
|
return getCacheEntry(twPatcher);
|
|
56
60
|
}
|
|
57
61
|
function getRuntimeClassSetSignature(twPatcher) {
|
|
58
|
-
|
|
62
|
+
const configSignature = getTailwindConfigSignature(twPatcher) ?? "config:missing";
|
|
63
|
+
const patchTargetSignature = getPatchTargetSignature(twPatcher);
|
|
64
|
+
return `${configSignature}|patch:${patchTargetSignature}`;
|
|
59
65
|
}
|
|
60
66
|
|
|
61
67
|
// src/tailwindcss/runtime.ts
|
|
@@ -73,14 +79,17 @@ function createTailwindPatchPromise(twPatcher, onPatched) {
|
|
|
73
79
|
}
|
|
74
80
|
});
|
|
75
81
|
}
|
|
76
|
-
async function refreshTailwindRuntimeState(state,
|
|
82
|
+
async function refreshTailwindRuntimeState(state, forceOrOptions) {
|
|
83
|
+
const normalizedOptions = typeof forceOrOptions === "boolean" ? { force: forceOrOptions } : forceOrOptions;
|
|
84
|
+
const force = normalizedOptions.force;
|
|
85
|
+
const clearCache = normalizedOptions.clearCache === true;
|
|
77
86
|
if (!force) {
|
|
78
87
|
return false;
|
|
79
88
|
}
|
|
80
89
|
await state.patchPromise;
|
|
81
90
|
let refreshed = false;
|
|
82
91
|
if (typeof state.refreshTailwindcssPatcher === "function") {
|
|
83
|
-
const next = await state.refreshTailwindcssPatcher({ clearCache
|
|
92
|
+
const next = await state.refreshTailwindcssPatcher({ clearCache });
|
|
84
93
|
if (next !== state.twPatcher) {
|
|
85
94
|
state.twPatcher = next;
|
|
86
95
|
}
|
|
@@ -131,7 +140,7 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
|
|
|
131
140
|
const refresh = activePatcher[refreshTailwindcssPatcherSymbol];
|
|
132
141
|
if (typeof refresh === "function") {
|
|
133
142
|
try {
|
|
134
|
-
const refreshed = await refresh({ clearCache: true });
|
|
143
|
+
const refreshed = await refresh({ clearCache: options.clearCache === true });
|
|
135
144
|
if (refreshed) {
|
|
136
145
|
activePatcher = refreshed;
|
|
137
146
|
}
|
|
@@ -192,7 +201,7 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
|
|
|
192
201
|
// package.json
|
|
193
202
|
var package_default = {
|
|
194
203
|
name: "weapp-tailwindcss",
|
|
195
|
-
version: "4.9.
|
|
204
|
+
version: "4.9.9-beta.0",
|
|
196
205
|
description: "\u628A tailwindcss \u539F\u5B50\u5316\u6837\u5F0F\u601D\u60F3\uFF0C\u5E26\u7ED9\u5C0F\u7A0B\u5E8F\u5F00\u53D1\u8005\u4EEC! bring tailwindcss to miniprogram developers!",
|
|
197
206
|
author: "ice breaker <1324318532@qq.com>",
|
|
198
207
|
license: "MIT",
|
|
@@ -361,6 +370,8 @@ var package_default = {
|
|
|
361
370
|
"test:dev": "vitest",
|
|
362
371
|
"test:ui": "vitest --ui",
|
|
363
372
|
bench: "vitest bench --config ./vitest.config.ts",
|
|
373
|
+
"bench:vite-perf": "tsx scripts/vite-perf-bench.ts",
|
|
374
|
+
"bench:vite-perf:summary": "tsx scripts/vite-perf-summary.ts",
|
|
364
375
|
"bench:js-handlers": "tsx scripts/js-bench.ts",
|
|
365
376
|
"bench:js-diff": "tsx scripts/js-bench-diff.ts",
|
|
366
377
|
tsd: "tsd",
|
|
@@ -372,7 +383,8 @@ var package_default = {
|
|
|
372
383
|
release: "tsx scripts/release.ts",
|
|
373
384
|
lint: "eslint .",
|
|
374
385
|
"lint:fix": "eslint ./src --fix",
|
|
375
|
-
postinstall: "node bin/weapp-tailwindcss.js patch"
|
|
386
|
+
postinstall: "node bin/weapp-tailwindcss.js patch",
|
|
387
|
+
"bench:vite-dev-hmr": "tsx scripts/vite-dev-hmr-bench.ts"
|
|
376
388
|
},
|
|
377
389
|
publishConfig: {
|
|
378
390
|
access: "public",
|
|
@@ -2900,6 +2912,7 @@ function getCompilerContext(opts) {
|
|
|
2900
2912
|
|
|
2901
2913
|
export {
|
|
2902
2914
|
createDebug,
|
|
2915
|
+
getRuntimeClassSetSignature,
|
|
2903
2916
|
createTailwindPatchPromise,
|
|
2904
2917
|
refreshTailwindRuntimeState,
|
|
2905
2918
|
collectRuntimeClassSet,
|
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkYY55J7K3js = require('./chunk-YY55J7K3.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -404,9 +404,9 @@ async function patchWorkspacePackage(workspaceRoot, dir, pkgName, options) {
|
|
|
404
404
|
try {
|
|
405
405
|
const patcher = createWorkspacePatcher(dir);
|
|
406
406
|
if (options.clearCache) {
|
|
407
|
-
await
|
|
407
|
+
await _chunkYY55J7K3js.clearTailwindcssPatcherCache.call(void 0, patcher, { removeDirectory: true });
|
|
408
408
|
}
|
|
409
|
-
const recorder =
|
|
409
|
+
const recorder = _chunkYY55J7K3js.createPatchTargetRecorder.call(void 0, dir, patcher, {
|
|
410
410
|
source: "cli",
|
|
411
411
|
cwd: dir,
|
|
412
412
|
recordTarget: options.recordTarget !== false,
|
|
@@ -415,7 +415,7 @@ async function patchWorkspacePackage(workspaceRoot, dir, pkgName, options) {
|
|
|
415
415
|
if (_optionalChain([recorder, 'optionalAccess', _12 => _12.message])) {
|
|
416
416
|
_chunkPO3CCFU7js.logger.info("[workspace] %s %s", displayName, recorder.message);
|
|
417
417
|
}
|
|
418
|
-
|
|
418
|
+
_chunkYY55J7K3js.logTailwindcssTarget.call(void 0, "cli", patcher, dir);
|
|
419
419
|
await patcher.patch();
|
|
420
420
|
if (_optionalChain([recorder, 'optionalAccess', _13 => _13.onPatched])) {
|
|
421
421
|
await recorder.onPatched();
|
|
@@ -546,9 +546,9 @@ var mountOptions = {
|
|
|
546
546
|
}
|
|
547
547
|
const patcher = await createPatcherWithDefaultExtendLengthUnits(ctx);
|
|
548
548
|
if (shouldClearCache) {
|
|
549
|
-
await
|
|
549
|
+
await _chunkYY55J7K3js.clearTailwindcssPatcherCache.call(void 0, patcher, { removeDirectory: true });
|
|
550
550
|
}
|
|
551
|
-
const recorder =
|
|
551
|
+
const recorder = _chunkYY55J7K3js.createPatchTargetRecorder.call(void 0, ctx.cwd, patcher, {
|
|
552
552
|
source: "cli",
|
|
553
553
|
cwd: ctx.cwd,
|
|
554
554
|
recordTarget: shouldRecordTarget,
|
|
@@ -557,7 +557,7 @@ var mountOptions = {
|
|
|
557
557
|
if (_optionalChain([recorder, 'optionalAccess', _15 => _15.message])) {
|
|
558
558
|
_chunkPO3CCFU7js.logger.info(recorder.message);
|
|
559
559
|
}
|
|
560
|
-
|
|
560
|
+
_chunkYY55J7K3js.logTailwindcssTarget.call(void 0, "cli", patcher, ctx.cwd);
|
|
561
561
|
await patcher.patch();
|
|
562
562
|
if (_optionalChain([recorder, 'optionalAccess', _16 => _16.onPatched])) {
|
|
563
563
|
const recordPath = await recorder.onPatched();
|
|
@@ -705,9 +705,9 @@ async function generateVscodeIntellisenseEntry(options) {
|
|
|
705
705
|
|
|
706
706
|
// src/cli.ts
|
|
707
707
|
_process2.default.title = "node (weapp-tailwindcss)";
|
|
708
|
-
if (_semver2.default.lt(_process2.default.versions.node,
|
|
708
|
+
if (_semver2.default.lt(_process2.default.versions.node, _chunkYY55J7K3js.WEAPP_TW_REQUIRED_NODE_VERSION)) {
|
|
709
709
|
_chunkPO3CCFU7js.logger.warn(
|
|
710
|
-
`You are using Node.js ${_process2.default.versions.node}. For weapp-tailwindcss, Node.js version >= v${
|
|
710
|
+
`You are using Node.js ${_process2.default.versions.node}. For weapp-tailwindcss, Node.js version >= v${_chunkYY55J7K3js.WEAPP_TW_REQUIRED_NODE_VERSION} is required.`
|
|
711
711
|
);
|
|
712
712
|
}
|
|
713
713
|
var cli = _tailwindcsspatch.createTailwindcssPatchCli.call(void 0, {
|
package/dist/cli.mjs
CHANGED
package/dist/core.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkA2ST4H4Yjs = require('./chunk-A2ST4H4Y.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkYY55J7K3js = require('./chunk-YY55J7K3.js');
|
|
9
9
|
require('./chunk-PO3CCFU7.js');
|
|
10
10
|
require('./chunk-LBZCKOMT.js');
|
|
11
11
|
require('./chunk-DYLQ6UOI.js');
|
|
@@ -15,9 +15,9 @@ require('./chunk-HAM3JEU2.js');
|
|
|
15
15
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
16
16
|
var _shared = require('@weapp-tailwindcss/shared');
|
|
17
17
|
function createContext(options = {}) {
|
|
18
|
-
const opts =
|
|
18
|
+
const opts = _chunkYY55J7K3js.getCompilerContext.call(void 0, options);
|
|
19
19
|
const { templateHandler, styleHandler, jsHandler, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
20
|
-
const patchRecorderState =
|
|
20
|
+
const patchRecorderState = _chunkA2ST4H4Yjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
21
21
|
source: "runtime",
|
|
22
22
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
23
23
|
});
|
|
@@ -29,7 +29,7 @@ function createContext(options = {}) {
|
|
|
29
29
|
onPatchCompleted: patchRecorderState.onPatchCompleted
|
|
30
30
|
};
|
|
31
31
|
async function refreshRuntimeState(force) {
|
|
32
|
-
await
|
|
32
|
+
await _chunkYY55J7K3js.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
33
33
|
}
|
|
34
34
|
async function transformWxss(rawCss, options2) {
|
|
35
35
|
await runtimeState.patchPromise;
|
|
@@ -38,7 +38,7 @@ function createContext(options = {}) {
|
|
|
38
38
|
}));
|
|
39
39
|
await refreshRuntimeState(true);
|
|
40
40
|
await runtimeState.patchPromise;
|
|
41
|
-
runtimeSet = await
|
|
41
|
+
runtimeSet = await _chunkYY55J7K3js.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
42
42
|
return result;
|
|
43
43
|
}
|
|
44
44
|
async function transformJs(rawJs, options2 = {}) {
|
|
@@ -48,7 +48,7 @@ function createContext(options = {}) {
|
|
|
48
48
|
} else {
|
|
49
49
|
await refreshRuntimeState(true);
|
|
50
50
|
await runtimeState.patchPromise;
|
|
51
|
-
runtimeSet = await
|
|
51
|
+
runtimeSet = await _chunkYY55J7K3js.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
52
52
|
}
|
|
53
53
|
return await jsHandler(rawJs, runtimeSet, options2);
|
|
54
54
|
}
|
|
@@ -57,7 +57,7 @@ function createContext(options = {}) {
|
|
|
57
57
|
if (!_optionalChain([options2, 'optionalAccess', _2 => _2.runtimeSet]) && runtimeSet.size === 0) {
|
|
58
58
|
await refreshRuntimeState(true);
|
|
59
59
|
await runtimeState.patchPromise;
|
|
60
|
-
runtimeSet = await
|
|
60
|
+
runtimeSet = await _chunkYY55J7K3js.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
61
61
|
}
|
|
62
62
|
return templateHandler(rawWxml, _shared.defuOverrideArray.call(void 0, options2, {
|
|
63
63
|
runtimeSet
|
package/dist/core.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
setupPatchRecorder
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NBS6RMNM.mjs";
|
|
4
4
|
import {
|
|
5
5
|
collectRuntimeClassSet,
|
|
6
6
|
getCompilerContext,
|
|
7
7
|
refreshTailwindRuntimeState
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YYE3U4L3.mjs";
|
|
9
9
|
import "./chunk-7D27E7TU.mjs";
|
|
10
10
|
import "./chunk-EGOFMIDI.mjs";
|
|
11
11
|
import "./chunk-OOHJLO5M.mjs";
|
package/dist/gulp.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkU4T2HGRZjs = require('./chunk-U4T2HGRZ.js');
|
|
4
4
|
require('./chunk-LTJQUORK.js');
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-A2ST4H4Y.js');
|
|
6
|
+
require('./chunk-YY55J7K3.js');
|
|
7
7
|
require('./chunk-PO3CCFU7.js');
|
|
8
8
|
require('./chunk-LBZCKOMT.js');
|
|
9
9
|
require('./chunk-DYLQ6UOI.js');
|
|
10
10
|
require('./chunk-HAM3JEU2.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.createPlugins =
|
|
13
|
+
exports.createPlugins = _chunkU4T2HGRZjs.createPlugins;
|
package/dist/gulp.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPlugins
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YVYWSXU7.mjs";
|
|
4
4
|
import "./chunk-RRHPTTCP.mjs";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-NBS6RMNM.mjs";
|
|
6
|
+
import "./chunk-YYE3U4L3.mjs";
|
|
7
7
|
import "./chunk-7D27E7TU.mjs";
|
|
8
8
|
import "./chunk-EGOFMIDI.mjs";
|
|
9
9
|
import "./chunk-OOHJLO5M.mjs";
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var _chunkCAFL5XBFjs = require('./chunk-CAFL5XBF.js');
|
|
5
|
+
require('./chunk-42HSNAKM.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkU4T2HGRZjs = require('./chunk-U4T2HGRZ.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkHQ2G6NBKjs = require('./chunk-HQ2G6NBK.js');
|
|
12
12
|
require('./chunk-DOX3RXJ2.js');
|
|
13
13
|
require('./chunk-LTJQUORK.js');
|
|
14
|
-
require('./chunk-
|
|
15
|
-
require('./chunk-
|
|
14
|
+
require('./chunk-A2ST4H4Y.js');
|
|
15
|
+
require('./chunk-YY55J7K3.js');
|
|
16
16
|
require('./chunk-PO3CCFU7.js');
|
|
17
17
|
require('./chunk-LBZCKOMT.js');
|
|
18
18
|
require('./chunk-DYLQ6UOI.js');
|
|
@@ -22,4 +22,4 @@ require('./chunk-HAM3JEU2.js');
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
exports.UnifiedViteWeappTailwindcssPlugin =
|
|
25
|
+
exports.UnifiedViteWeappTailwindcssPlugin = _chunkHQ2G6NBKjs.UnifiedViteWeappTailwindcssPlugin; exports.UnifiedWebpackPluginV5 = _chunkCAFL5XBFjs.UnifiedWebpackPluginV5; exports.createPlugins = _chunkU4T2HGRZjs.createPlugins; exports.weappTailwindcssPackageDir = _chunkCAFL5XBFjs.weappTailwindcssPackageDir;
|
package/dist/index.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedWebpackPluginV5,
|
|
3
3
|
weappTailwindcssPackageDir
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-YPIQUBC4.mjs";
|
|
5
|
+
import "./chunk-IY5ZVBL2.mjs";
|
|
6
6
|
import {
|
|
7
7
|
createPlugins
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YVYWSXU7.mjs";
|
|
9
9
|
import {
|
|
10
10
|
UnifiedViteWeappTailwindcssPlugin
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-FT3YGOHE.mjs";
|
|
12
12
|
import "./chunk-F2CKKG6Q.mjs";
|
|
13
13
|
import "./chunk-RRHPTTCP.mjs";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-NBS6RMNM.mjs";
|
|
15
|
+
import "./chunk-YYE3U4L3.mjs";
|
|
16
16
|
import "./chunk-7D27E7TU.mjs";
|
|
17
17
|
import "./chunk-EGOFMIDI.mjs";
|
|
18
18
|
import "./chunk-OOHJLO5M.mjs";
|
package/dist/vite.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkHQ2G6NBKjs = require('./chunk-HQ2G6NBK.js');
|
|
4
4
|
require('./chunk-DOX3RXJ2.js');
|
|
5
5
|
require('./chunk-LTJQUORK.js');
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-A2ST4H4Y.js');
|
|
7
|
+
require('./chunk-YY55J7K3.js');
|
|
8
8
|
require('./chunk-PO3CCFU7.js');
|
|
9
9
|
require('./chunk-LBZCKOMT.js');
|
|
10
10
|
require('./chunk-DYLQ6UOI.js');
|
|
11
11
|
require('./chunk-HAM3JEU2.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.UnifiedViteWeappTailwindcssPlugin =
|
|
14
|
+
exports.UnifiedViteWeappTailwindcssPlugin = _chunkHQ2G6NBKjs.UnifiedViteWeappTailwindcssPlugin;
|
package/dist/vite.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedViteWeappTailwindcssPlugin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FT3YGOHE.mjs";
|
|
4
4
|
import "./chunk-F2CKKG6Q.mjs";
|
|
5
5
|
import "./chunk-RRHPTTCP.mjs";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-NBS6RMNM.mjs";
|
|
7
|
+
import "./chunk-YYE3U4L3.mjs";
|
|
8
8
|
import "./chunk-7D27E7TU.mjs";
|
|
9
9
|
import "./chunk-EGOFMIDI.mjs";
|
|
10
10
|
import "./chunk-OOHJLO5M.mjs";
|
package/dist/webpack.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var _chunkCAFL5XBFjs = require('./chunk-CAFL5XBF.js');
|
|
5
|
+
require('./chunk-42HSNAKM.js');
|
|
6
6
|
require('./chunk-DOX3RXJ2.js');
|
|
7
7
|
require('./chunk-LTJQUORK.js');
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-A2ST4H4Y.js');
|
|
9
|
+
require('./chunk-YY55J7K3.js');
|
|
10
10
|
require('./chunk-PO3CCFU7.js');
|
|
11
11
|
require('./chunk-LBZCKOMT.js');
|
|
12
12
|
require('./chunk-DYLQ6UOI.js');
|
|
@@ -14,4 +14,4 @@ require('./chunk-HAM3JEU2.js');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.UnifiedWebpackPluginV5 =
|
|
17
|
+
exports.UnifiedWebpackPluginV5 = _chunkCAFL5XBFjs.UnifiedWebpackPluginV5; exports.weappTailwindcssPackageDir = _chunkCAFL5XBFjs.weappTailwindcssPackageDir;
|
package/dist/webpack.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedWebpackPluginV5,
|
|
3
3
|
weappTailwindcssPackageDir
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-YPIQUBC4.mjs";
|
|
5
|
+
import "./chunk-IY5ZVBL2.mjs";
|
|
6
6
|
import "./chunk-F2CKKG6Q.mjs";
|
|
7
7
|
import "./chunk-RRHPTTCP.mjs";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-NBS6RMNM.mjs";
|
|
9
|
+
import "./chunk-YYE3U4L3.mjs";
|
|
10
10
|
import "./chunk-7D27E7TU.mjs";
|
|
11
11
|
import "./chunk-EGOFMIDI.mjs";
|
|
12
12
|
import "./chunk-OOHJLO5M.mjs";
|
package/dist/webpack4.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunk42HSNAKMjs = require('./chunk-42HSNAKM.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -22,14 +22,14 @@ var _chunkDOX3RXJ2js = require('./chunk-DOX3RXJ2.js');
|
|
|
22
22
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunkA2ST4H4Yjs = require('./chunk-A2ST4H4Y.js');
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkYY55J7K3js = require('./chunk-YY55J7K3.js');
|
|
33
33
|
require('./chunk-PO3CCFU7.js');
|
|
34
34
|
require('./chunk-LBZCKOMT.js');
|
|
35
35
|
|
|
@@ -53,7 +53,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
53
53
|
refreshRuntimeState,
|
|
54
54
|
debug: debug2
|
|
55
55
|
} = options;
|
|
56
|
-
compiler.hooks.emit.tapPromise(
|
|
56
|
+
compiler.hooks.emit.tapPromise(_chunkYY55J7K3js.pluginName, async (compilation) => {
|
|
57
57
|
await runtimeState.patchPromise;
|
|
58
58
|
compilerOptions.onStart();
|
|
59
59
|
debug2("start");
|
|
@@ -119,7 +119,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
119
119
|
const groupedEntries = _chunkDYLQ6UOIjs.getGroupedEntries.call(void 0, entries, compilerOptions);
|
|
120
120
|
await refreshRuntimeState(true);
|
|
121
121
|
await runtimeState.patchPromise;
|
|
122
|
-
const runtimeSet = await
|
|
122
|
+
const runtimeSet = await _chunkYY55J7K3js.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
123
123
|
debug2("get runtimeSet, class count: %d", runtimeSet.size);
|
|
124
124
|
const tasks = [];
|
|
125
125
|
if (Array.isArray(groupedEntries.html)) {
|
|
@@ -156,7 +156,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
156
156
|
const jsTaskFactories = [];
|
|
157
157
|
if (Array.isArray(groupedEntries.js)) {
|
|
158
158
|
for (const [file] of groupedEntries.js) {
|
|
159
|
-
const cacheKey =
|
|
159
|
+
const cacheKey = _chunk42HSNAKMjs.getCacheKey.call(void 0, file);
|
|
160
160
|
const assetSource = compilation.assets[file];
|
|
161
161
|
if (!assetSource) {
|
|
162
162
|
continue;
|
|
@@ -259,9 +259,9 @@ function setupWebpackV4Loaders(options) {
|
|
|
259
259
|
getClassSetInLoader,
|
|
260
260
|
debug: debug2
|
|
261
261
|
} = options;
|
|
262
|
-
const isMpxApp =
|
|
262
|
+
const isMpxApp = _chunk42HSNAKMjs.isMpx.call(void 0, appType);
|
|
263
263
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
264
|
-
|
|
264
|
+
_chunk42HSNAKMjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
|
|
265
265
|
}
|
|
266
266
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
267
267
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -274,12 +274,12 @@ function setupWebpackV4Loaders(options) {
|
|
|
274
274
|
const classSetLoaderOptions = {
|
|
275
275
|
getClassSet: getClassSetInLoader
|
|
276
276
|
};
|
|
277
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
277
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunk42HSNAKMjs.createLoaderAnchorFinders.call(void 0, appType);
|
|
278
278
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
279
279
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
280
280
|
} : void 0;
|
|
281
281
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
282
|
-
|
|
282
|
+
_chunk42HSNAKMjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
283
283
|
}
|
|
284
284
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
285
285
|
loader: runtimeClassSetLoader,
|
|
@@ -298,19 +298,19 @@ function setupWebpackV4Loaders(options) {
|
|
|
298
298
|
type: null
|
|
299
299
|
};
|
|
300
300
|
};
|
|
301
|
-
compiler.hooks.compilation.tap(
|
|
302
|
-
compilation.hooks.normalModuleLoader.tap(
|
|
301
|
+
compiler.hooks.compilation.tap(_chunkYY55J7K3js.pluginName, (compilation) => {
|
|
302
|
+
compilation.hooks.normalModuleLoader.tap(_chunkYY55J7K3js.pluginName, (_loaderContext, module) => {
|
|
303
303
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
304
304
|
if (!hasRuntimeLoader) {
|
|
305
305
|
return;
|
|
306
306
|
}
|
|
307
|
-
if (shouldRewriteCssImports &&
|
|
308
|
-
|
|
307
|
+
if (shouldRewriteCssImports && _chunk42HSNAKMjs.isMpx.call(void 0, appType) && typeof _loaderContext.resolve === "function") {
|
|
308
|
+
_chunk42HSNAKMjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, true);
|
|
309
309
|
}
|
|
310
310
|
const loaderEntries = module.loaders || [];
|
|
311
311
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
312
312
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
313
|
-
const isCssModule =
|
|
313
|
+
const isCssModule = _chunk42HSNAKMjs.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
|
|
314
314
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
315
315
|
debug2("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
316
316
|
}
|
|
@@ -344,7 +344,7 @@ function setupWebpackV4Loaders(options) {
|
|
|
344
344
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
|
-
if (runtimeClassSetLoaderExists && !
|
|
347
|
+
if (runtimeClassSetLoaderExists && !_chunk42HSNAKMjs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
348
348
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
349
349
|
if (anchorIndex === -1) {
|
|
350
350
|
anchorlessInsert(createRuntimeClassSetLoaderEntry(), "before");
|
|
@@ -358,11 +358,11 @@ function setupWebpackV4Loaders(options) {
|
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
// src/bundlers/webpack/BaseUnifiedPlugin/v4.ts
|
|
361
|
-
var debug =
|
|
361
|
+
var debug = _chunkYY55J7K3js.createDebug.call(void 0, );
|
|
362
362
|
var weappTailwindcssPackageDir = _chunkDOX3RXJ2js.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
363
363
|
var UnifiedWebpackPluginV4 = class {
|
|
364
364
|
constructor(options = {}) {
|
|
365
|
-
this.options =
|
|
365
|
+
this.options = _chunkYY55J7K3js.getCompilerContext.call(void 0, options);
|
|
366
366
|
this.appType = this.options.appType;
|
|
367
367
|
}
|
|
368
368
|
apply(compiler) {
|
|
@@ -378,19 +378,19 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
378
378
|
const disabledOptions = _chunkDOX3RXJ2js.resolveDisabledOptions.call(void 0, disabled);
|
|
379
379
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
380
380
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
381
|
-
const isMpxApp =
|
|
381
|
+
const isMpxApp = _chunk42HSNAKMjs.isMpx.call(void 0, this.appType);
|
|
382
382
|
if (shouldRewriteCssImports) {
|
|
383
|
-
|
|
383
|
+
_chunk42HSNAKMjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
384
384
|
pkgDir: weappTailwindcssPackageDir,
|
|
385
385
|
enabled: true,
|
|
386
386
|
appType: this.appType
|
|
387
387
|
});
|
|
388
|
-
|
|
388
|
+
_chunk42HSNAKMjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
389
389
|
}
|
|
390
390
|
if (disabledOptions.plugin) {
|
|
391
391
|
return;
|
|
392
392
|
}
|
|
393
|
-
const patchRecorderState =
|
|
393
|
+
const patchRecorderState = _chunkA2ST4H4Yjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
394
394
|
source: "runtime",
|
|
395
395
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
396
396
|
});
|
|
@@ -401,12 +401,12 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
401
401
|
onPatchCompleted: patchRecorderState.onPatchCompleted
|
|
402
402
|
};
|
|
403
403
|
const refreshRuntimeState = async (force) => {
|
|
404
|
-
await
|
|
404
|
+
await _chunkYY55J7K3js.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
405
405
|
};
|
|
406
406
|
async function getClassSetInLoader() {
|
|
407
407
|
await refreshRuntimeState(true);
|
|
408
408
|
await runtimeState.patchPromise;
|
|
409
|
-
await
|
|
409
|
+
await _chunkYY55J7K3js.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
410
410
|
}
|
|
411
411
|
onLoad();
|
|
412
412
|
setupWebpackV4Loaders({
|
package/dist/webpack4.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
isMpx,
|
|
10
10
|
patchMpxLoaderResolve,
|
|
11
11
|
setupMpxTailwindcssRedirect
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-IY5ZVBL2.mjs";
|
|
13
13
|
import {
|
|
14
14
|
pushConcurrentTaskFactories,
|
|
15
15
|
resolveDisabledOptions,
|
|
@@ -22,14 +22,14 @@ import {
|
|
|
22
22
|
} from "./chunk-RRHPTTCP.mjs";
|
|
23
23
|
import {
|
|
24
24
|
setupPatchRecorder
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-NBS6RMNM.mjs";
|
|
26
26
|
import {
|
|
27
27
|
collectRuntimeClassSet,
|
|
28
28
|
createDebug,
|
|
29
29
|
getCompilerContext,
|
|
30
30
|
pluginName,
|
|
31
31
|
refreshTailwindRuntimeState
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-YYE3U4L3.mjs";
|
|
33
33
|
import "./chunk-7D27E7TU.mjs";
|
|
34
34
|
import "./chunk-EGOFMIDI.mjs";
|
|
35
35
|
import {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.9-beta.0",
|
|
4
4
|
"description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -184,9 +184,9 @@
|
|
|
184
184
|
"tailwindcss-patch": "^8.6.1",
|
|
185
185
|
"webpack-sources": "3.3.3",
|
|
186
186
|
"yaml": "^2.8.2",
|
|
187
|
+
"@weapp-tailwindcss/shared": "1.1.2",
|
|
187
188
|
"@weapp-tailwindcss/logger": "1.1.0",
|
|
188
|
-
"@weapp-tailwindcss/postcss": "2.1.4"
|
|
189
|
-
"@weapp-tailwindcss/shared": "1.1.2"
|
|
189
|
+
"@weapp-tailwindcss/postcss": "2.1.4"
|
|
190
190
|
},
|
|
191
191
|
"scripts": {
|
|
192
192
|
"dev": "tsup --watch --sourcemap",
|
|
@@ -199,6 +199,8 @@
|
|
|
199
199
|
"test:dev": "vitest",
|
|
200
200
|
"test:ui": "vitest --ui",
|
|
201
201
|
"bench": "vitest bench --config ./vitest.config.ts",
|
|
202
|
+
"bench:vite-perf": "tsx scripts/vite-perf-bench.ts",
|
|
203
|
+
"bench:vite-perf:summary": "tsx scripts/vite-perf-summary.ts",
|
|
202
204
|
"bench:js-handlers": "tsx scripts/js-bench.ts",
|
|
203
205
|
"bench:js-diff": "tsx scripts/js-bench-diff.ts",
|
|
204
206
|
"tsd": "tsd",
|
|
@@ -210,6 +212,7 @@
|
|
|
210
212
|
"release": "tsx scripts/release.ts",
|
|
211
213
|
"lint": "eslint .",
|
|
212
214
|
"lint:fix": "eslint ./src --fix",
|
|
213
|
-
"postinstall": "node bin/weapp-tailwindcss.js patch"
|
|
215
|
+
"postinstall": "node bin/weapp-tailwindcss.js patch",
|
|
216
|
+
"bench:vite-dev-hmr": "tsx scripts/vite-dev-hmr-bench.ts"
|
|
214
217
|
}
|
|
215
218
|
}
|