weapp-tailwindcss 4.5.1 → 4.6.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-CCXN3K4T.js → chunk-7CGHD2TI.js} +17 -15
- package/dist/{chunk-P54HILYW.mjs → chunk-7PGHZOTU.mjs} +88 -221
- package/dist/chunk-AXLRUW5H.js +776 -0
- package/dist/{chunk-PLMJW644.js → chunk-DWAEHRHN.js} +1 -4
- package/dist/{chunk-NHB7NFQC.js → chunk-E5PXIHDN.js} +1 -1
- package/dist/chunk-FB5P4TRH.js +70 -0
- package/dist/{chunk-7NGYHFX4.js → chunk-FVA7Y2YU.js} +21 -19
- package/dist/{chunk-FOSGDQZ7.js → chunk-I7FYDXN6.js} +3 -5
- package/dist/chunk-IY2OKZE6.mjs +773 -0
- package/dist/{chunk-3ICGFLVO.mjs → chunk-JG5LBGLH.mjs} +27 -7
- package/dist/{chunk-FWIGQ4RY.mjs → chunk-KHILYAA4.mjs} +1 -1
- package/dist/chunk-LTJQUORK.js +32 -0
- package/dist/{chunk-QOHOLLWR.js → chunk-M6DWZX4H.js} +31 -11
- package/dist/{chunk-4JDQJ2K4.mjs → chunk-MXVUK23K.mjs} +14 -12
- package/dist/{chunk-VJKW7COS.js → chunk-OVDIACVK.js} +94 -230
- package/dist/{chunk-H4JTYYOI.mjs → chunk-RRHPTTCP.mjs} +0 -11
- package/dist/{chunk-7KER5VQX.mjs → chunk-TTDQ4TK2.mjs} +14 -12
- package/dist/{chunk-Q67IXIAH.mjs → chunk-VSRDBMDB.mjs} +1 -4
- package/dist/{chunk-IHKVNALD.mjs → chunk-YLNOOPZL.mjs} +3 -5
- package/dist/chunk-YPBRGP6K.mjs +70 -0
- package/dist/cli.js +11 -7
- package/dist/cli.mjs +11 -7
- package/dist/core.d.mts +0 -1
- package/dist/core.d.ts +0 -1
- package/dist/core.js +23 -11
- package/dist/core.mjs +21 -9
- package/dist/css-macro/postcss.js +1 -1
- package/dist/css-macro/postcss.mjs +1 -1
- package/dist/css-macro.js +1 -1
- package/dist/css-macro.mjs +1 -1
- package/dist/defaults.d.mts +0 -1
- package/dist/defaults.d.ts +0 -1
- package/dist/defaults.js +3 -3
- package/dist/defaults.mjs +2 -2
- package/dist/escape.d.mts +0 -1
- package/dist/escape.d.ts +0 -1
- package/dist/escape.js +3 -3
- package/dist/escape.mjs +2 -2
- package/dist/gulp.d.mts +0 -1
- package/dist/gulp.d.ts +0 -1
- package/dist/gulp.js +9 -7
- package/dist/gulp.mjs +8 -6
- package/dist/index.d.mts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +11 -9
- package/dist/index.mjs +10 -8
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss-html-transform.mjs +1 -1
- package/dist/presets.d.mts +9 -2
- package/dist/presets.d.ts +9 -2
- package/dist/presets.js +68 -14
- package/dist/presets.mjs +66 -12
- package/dist/types.d.mts +10 -30
- package/dist/types.d.ts +10 -30
- package/dist/types.js +1 -1
- package/dist/types.mjs +1 -1
- package/dist/vite.d.mts +0 -1
- package/dist/vite.d.ts +0 -1
- package/dist/vite.js +9 -7
- package/dist/vite.mjs +8 -6
- package/dist/weapp-tw-runtime-loader.js +4 -1
- package/dist/webpack.d.mts +0 -1
- package/dist/webpack.d.ts +0 -1
- package/dist/webpack.js +9 -7
- package/dist/webpack.mjs +8 -6
- package/dist/webpack4.d.mts +0 -1
- package/dist/webpack4.d.ts +0 -1
- package/dist/webpack4.js +21 -18
- package/dist/webpack4.mjs +17 -14
- package/package.json +7 -8
- package/dist/chunk-2NRTWL47.js +0 -43
|
@@ -3,19 +3,22 @@ import {
|
|
|
3
3
|
toAbsoluteOutputPath
|
|
4
4
|
} from "./chunk-34T2BFTJ.mjs";
|
|
5
5
|
import {
|
|
6
|
-
createDebug,
|
|
7
6
|
processCachedTask
|
|
8
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-RRHPTTCP.mjs";
|
|
8
|
+
import {
|
|
9
|
+
collectRuntimeClassSet,
|
|
10
|
+
createDebug
|
|
11
|
+
} from "./chunk-YPBRGP6K.mjs";
|
|
9
12
|
import {
|
|
10
13
|
vitePluginName
|
|
11
14
|
} from "./chunk-CMUA5KCO.mjs";
|
|
12
15
|
import {
|
|
13
16
|
generateCode,
|
|
14
17
|
getCompilerContext
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-7PGHZOTU.mjs";
|
|
16
19
|
import {
|
|
17
20
|
replaceWxml
|
|
18
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-VSRDBMDB.mjs";
|
|
19
22
|
import {
|
|
20
23
|
getGroupedEntries
|
|
21
24
|
} from "./chunk-ZNKIYZRQ.mjs";
|
|
@@ -248,7 +251,6 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
248
251
|
jsHandler,
|
|
249
252
|
mainCssChunkMatcher,
|
|
250
253
|
appType,
|
|
251
|
-
setMangleRuntimeSet,
|
|
252
254
|
cache,
|
|
253
255
|
twPatcher,
|
|
254
256
|
uniAppX
|
|
@@ -256,7 +258,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
256
258
|
if (disabled) {
|
|
257
259
|
return;
|
|
258
260
|
}
|
|
259
|
-
twPatcher.patch();
|
|
261
|
+
const patchPromise = Promise.resolve(twPatcher.patch());
|
|
260
262
|
let runtimeSet;
|
|
261
263
|
let resolvedConfig;
|
|
262
264
|
onLoad();
|
|
@@ -278,6 +280,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
278
280
|
}
|
|
279
281
|
},
|
|
280
282
|
async generateBundle(_opt, bundle) {
|
|
283
|
+
await patchPromise;
|
|
281
284
|
debug("start");
|
|
282
285
|
onStart();
|
|
283
286
|
const entries = Object.entries(bundle);
|
|
@@ -293,8 +296,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
293
296
|
}
|
|
294
297
|
const moduleGraphOptions = createBundleModuleGraphOptions(outDir, jsEntries);
|
|
295
298
|
const groupedEntries = getGroupedEntries(entries, opts);
|
|
296
|
-
runtimeSet = await twPatcher
|
|
297
|
-
setMangleRuntimeSet(runtimeSet);
|
|
299
|
+
runtimeSet = await collectRuntimeClassSet(twPatcher);
|
|
298
300
|
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
299
301
|
const handleLinkedUpdate = (fileName, previous, next) => {
|
|
300
302
|
onUpdate(fileName, previous, next);
|
|
@@ -421,6 +423,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
421
423
|
debug("css cache hit: %s", file);
|
|
422
424
|
},
|
|
423
425
|
async transform() {
|
|
426
|
+
await patchPromise;
|
|
424
427
|
const { css } = await styleHandler(rawSource, {
|
|
425
428
|
isMainChunk: mainCssChunkMatcher(originalSource.fileName, appType),
|
|
426
429
|
postcssOptions: {
|
|
@@ -454,6 +457,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
454
457
|
name: `weapp-tailwindcss:uni-app-x:css${enforce ? `:${enforce}` : ""}`,
|
|
455
458
|
enforce,
|
|
456
459
|
async transform(code, id) {
|
|
460
|
+
await patchPromise;
|
|
457
461
|
const { query } = parseVueRequest(id);
|
|
458
462
|
if (isCSSRequest(id) || query.vue && query.type === "style") {
|
|
459
463
|
const postcssResult = await styleHandler(code, {
|
|
@@ -493,10 +497,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
493
497
|
name: "weapp-tailwindcss:uni-app-x:nvue",
|
|
494
498
|
enforce: "pre",
|
|
495
499
|
async buildStart() {
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
runtimeSet = res.classSet;
|
|
499
|
-
}
|
|
500
|
+
await patchPromise;
|
|
501
|
+
runtimeSet = await collectRuntimeClassSet(twPatcher);
|
|
500
502
|
},
|
|
501
503
|
transform(code, id) {
|
|
502
504
|
return transformUVue(code, id, jsHandler, runtimeSet);
|
|
@@ -4,14 +4,11 @@ function replaceWxml(original, options = {
|
|
|
4
4
|
keepEOL: false,
|
|
5
5
|
escapeMap: MappingChars2String
|
|
6
6
|
}) {
|
|
7
|
-
const { keepEOL, escapeMap,
|
|
7
|
+
const { keepEOL, escapeMap, ignoreHead } = options;
|
|
8
8
|
let res = original;
|
|
9
9
|
if (!keepEOL) {
|
|
10
10
|
res = res.replaceAll(/[\n\r]+/g, "");
|
|
11
11
|
}
|
|
12
|
-
if (mangleContext) {
|
|
13
|
-
res = mangleContext.wxmlHandler(res);
|
|
14
|
-
}
|
|
15
12
|
res = escape(res, {
|
|
16
13
|
map: escapeMap,
|
|
17
14
|
ignoreHead
|
|
@@ -90,7 +90,7 @@ function getDefaultOptions() {
|
|
|
90
90
|
},
|
|
91
91
|
disabledDefaultTemplateHandler: false,
|
|
92
92
|
cssSelectorReplacement: {
|
|
93
|
-
root: "page",
|
|
93
|
+
root: ["page", ".tw-root"],
|
|
94
94
|
universal: ["view", "text"]
|
|
95
95
|
},
|
|
96
96
|
babelParserOptions: {
|
|
@@ -106,10 +106,8 @@ function getDefaultOptions() {
|
|
|
106
106
|
ignoreCallExpressionIdentifiers: isPackageExists("@weapp-tailwindcss/merge") ? ["twMerge", "twJoin", "cva", "tv"] : [],
|
|
107
107
|
ignoreTaggedTemplateExpressionIdentifiers: ["weappTwIgnore"],
|
|
108
108
|
tailwindcssPatcherOptions: {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
return !isAllowedClassName(className);
|
|
112
|
-
}
|
|
109
|
+
filter(className) {
|
|
110
|
+
return !isAllowedClassName(className);
|
|
113
111
|
}
|
|
114
112
|
},
|
|
115
113
|
logLevel: "info"
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// src/debug/index.ts
|
|
2
|
+
import _createDebug from "debug";
|
|
3
|
+
var _debug = _createDebug("weapp-tw");
|
|
4
|
+
function createDebug(prefix) {
|
|
5
|
+
function debug2(formatter, ...args) {
|
|
6
|
+
return _debug((prefix ?? "") + formatter, ...args);
|
|
7
|
+
}
|
|
8
|
+
return debug2;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// src/tailwindcss/runtime.ts
|
|
12
|
+
var debug = createDebug("[tailwindcss:runtime] ");
|
|
13
|
+
function shouldPreferSync(majorVersion) {
|
|
14
|
+
if (majorVersion == null) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
if (majorVersion === 3) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
if (majorVersion === 4) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
function tryGetRuntimeClassSetSync(twPatcher) {
|
|
26
|
+
if (typeof twPatcher.getClassSetSync !== "function") {
|
|
27
|
+
return void 0;
|
|
28
|
+
}
|
|
29
|
+
if (!shouldPreferSync(twPatcher.majorVersion)) {
|
|
30
|
+
return void 0;
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
return twPatcher.getClassSetSync();
|
|
34
|
+
} catch (error) {
|
|
35
|
+
if (twPatcher.majorVersion === 4) {
|
|
36
|
+
debug("getClassSetSync() unavailable for tailwindcss v4, fallback to async getClassSet(): %O", error);
|
|
37
|
+
} else {
|
|
38
|
+
debug("getClassSetSync() failed, fallback to async getClassSet(): %O", error);
|
|
39
|
+
}
|
|
40
|
+
return void 0;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async function collectRuntimeClassSet(twPatcher) {
|
|
44
|
+
const syncSet = tryGetRuntimeClassSetSync(twPatcher);
|
|
45
|
+
if (syncSet) {
|
|
46
|
+
return syncSet;
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
const result = await twPatcher.extract({ write: false });
|
|
50
|
+
if (result?.classSet) {
|
|
51
|
+
return result.classSet;
|
|
52
|
+
}
|
|
53
|
+
} catch (error) {
|
|
54
|
+
debug("extract() failed, fallback to getClassSet(): %O", error);
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
const fallbackSet = await Promise.resolve(twPatcher.getClassSet());
|
|
58
|
+
if (fallbackSet) {
|
|
59
|
+
return fallbackSet;
|
|
60
|
+
}
|
|
61
|
+
} catch (error) {
|
|
62
|
+
debug("getClassSet() failed, returning empty set: %O", error);
|
|
63
|
+
}
|
|
64
|
+
return /* @__PURE__ */ new Set();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export {
|
|
68
|
+
createDebug,
|
|
69
|
+
collectRuntimeClassSet
|
|
70
|
+
};
|
package/dist/cli.js
CHANGED
|
@@ -6,11 +6,12 @@ var _chunkOXASK55Qjs = require('./chunk-OXASK55Q.js');
|
|
|
6
6
|
var _chunkOGROHM4Ljs = require('./chunk-OGROHM4L.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('./chunk-
|
|
11
|
-
require('./chunk-
|
|
9
|
+
var _chunkOVDIACVKjs = require('./chunk-OVDIACVK.js');
|
|
10
|
+
require('./chunk-DWAEHRHN.js');
|
|
11
|
+
require('./chunk-AXLRUW5H.js');
|
|
12
|
+
require('./chunk-I7FYDXN6.js');
|
|
12
13
|
require('./chunk-UW3WHSZ5.js');
|
|
13
|
-
require('./chunk-
|
|
14
|
+
require('./chunk-E5PXIHDN.js');
|
|
14
15
|
|
|
15
16
|
// src/cli.ts
|
|
16
17
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
@@ -23,7 +24,10 @@ if (_semver2.default.lt(_process2.default.versions.node, _chunkOGROHM4Ljs.WEAPP_
|
|
|
23
24
|
);
|
|
24
25
|
}
|
|
25
26
|
var command = args[0];
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
async function run() {
|
|
28
|
+
if (command === "patch") {
|
|
29
|
+
const ctx = _chunkOVDIACVKjs.getCompilerContext.call(void 0, );
|
|
30
|
+
await ctx.twPatcher.patch();
|
|
31
|
+
}
|
|
29
32
|
}
|
|
33
|
+
void run();
|
package/dist/cli.mjs
CHANGED
|
@@ -6,11 +6,12 @@ import {
|
|
|
6
6
|
} from "./chunk-CMUA5KCO.mjs";
|
|
7
7
|
import {
|
|
8
8
|
getCompilerContext
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-7PGHZOTU.mjs";
|
|
10
|
+
import "./chunk-VSRDBMDB.mjs";
|
|
11
|
+
import "./chunk-IY2OKZE6.mjs";
|
|
12
|
+
import "./chunk-YLNOOPZL.mjs";
|
|
12
13
|
import "./chunk-ZNKIYZRQ.mjs";
|
|
13
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-KHILYAA4.mjs";
|
|
14
15
|
|
|
15
16
|
// src/cli.ts
|
|
16
17
|
import process from "process";
|
|
@@ -23,7 +24,10 @@ if (semver.lt(process.versions.node, WEAPP_TW_REQUIRED_NODE_VERSION)) {
|
|
|
23
24
|
);
|
|
24
25
|
}
|
|
25
26
|
var command = args[0];
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
async function run() {
|
|
28
|
+
if (command === "patch") {
|
|
29
|
+
const ctx = getCompilerContext();
|
|
30
|
+
await ctx.twPatcher.patch();
|
|
31
|
+
}
|
|
29
32
|
}
|
|
33
|
+
void run();
|
package/dist/core.d.mts
CHANGED
|
@@ -2,7 +2,6 @@ import { UserDefinedOptions, ITemplateHandlerOptions, CreateJsHandlerOptions, Js
|
|
|
2
2
|
import * as postcss from 'postcss';
|
|
3
3
|
import { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
|
|
4
4
|
import '@babel/parser';
|
|
5
|
-
import '@weapp-tailwindcss/mangle';
|
|
6
5
|
import 'magic-string';
|
|
7
6
|
import 'tailwindcss-patch';
|
|
8
7
|
import 'node:buffer';
|
package/dist/core.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { UserDefinedOptions, ITemplateHandlerOptions, CreateJsHandlerOptions, Js
|
|
|
2
2
|
import * as postcss from 'postcss';
|
|
3
3
|
import { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
|
|
4
4
|
import '@babel/parser';
|
|
5
|
-
import '@weapp-tailwindcss/mangle';
|
|
6
5
|
import 'magic-string';
|
|
7
6
|
import 'tailwindcss-patch';
|
|
8
7
|
import 'node:buffer';
|
package/dist/core.js
CHANGED
|
@@ -1,28 +1,40 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
var _chunkFB5P4TRHjs = require('./chunk-FB5P4TRH.js');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkOVDIACVKjs = require('./chunk-OVDIACVK.js');
|
|
7
|
+
require('./chunk-DWAEHRHN.js');
|
|
8
|
+
require('./chunk-AXLRUW5H.js');
|
|
9
|
+
require('./chunk-I7FYDXN6.js');
|
|
6
10
|
require('./chunk-UW3WHSZ5.js');
|
|
7
|
-
require('./chunk-
|
|
11
|
+
require('./chunk-E5PXIHDN.js');
|
|
8
12
|
|
|
9
13
|
// src/core.ts
|
|
10
14
|
var _shared = require('@weapp-tailwindcss/shared');
|
|
11
15
|
function createContext(options = {}) {
|
|
12
|
-
const opts =
|
|
16
|
+
const opts = _chunkOVDIACVKjs.getCompilerContext.call(void 0, options);
|
|
13
17
|
const { templateHandler, styleHandler, jsHandler, twPatcher } = opts;
|
|
14
18
|
let runtimeSet = /* @__PURE__ */ new Set();
|
|
15
|
-
twPatcher.patch();
|
|
16
|
-
function transformWxss(rawCss, options2) {
|
|
17
|
-
|
|
19
|
+
const patchPromise = Promise.resolve(twPatcher.patch());
|
|
20
|
+
async function transformWxss(rawCss, options2) {
|
|
21
|
+
await patchPromise;
|
|
22
|
+
const result = await styleHandler(rawCss, _shared.defuOverrideArray.call(void 0, options2, {
|
|
18
23
|
isMainChunk: true
|
|
19
24
|
}));
|
|
25
|
+
runtimeSet = await _chunkFB5P4TRHjs.collectRuntimeClassSet.call(void 0, twPatcher);
|
|
26
|
+
return result;
|
|
20
27
|
}
|
|
21
28
|
async function transformJs(rawJs, options2 = {}) {
|
|
22
|
-
|
|
29
|
+
await patchPromise;
|
|
30
|
+
runtimeSet = options2 && options2.runtimeSet ? options2.runtimeSet : await _chunkFB5P4TRHjs.collectRuntimeClassSet.call(void 0, twPatcher);
|
|
23
31
|
return await jsHandler(rawJs, runtimeSet, options2);
|
|
24
32
|
}
|
|
25
|
-
function transformWxml(rawWxml, options2) {
|
|
33
|
+
async function transformWxml(rawWxml, options2) {
|
|
34
|
+
await patchPromise;
|
|
35
|
+
if (!_optionalChain([options2, 'optionalAccess', _ => _.runtimeSet]) && runtimeSet.size === 0) {
|
|
36
|
+
runtimeSet = await _chunkFB5P4TRHjs.collectRuntimeClassSet.call(void 0, twPatcher);
|
|
37
|
+
}
|
|
26
38
|
return templateHandler(rawWxml, _shared.defuOverrideArray.call(void 0, options2, {
|
|
27
39
|
runtimeSet
|
|
28
40
|
}));
|
package/dist/core.mjs
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
collectRuntimeClassSet
|
|
3
|
+
} from "./chunk-YPBRGP6K.mjs";
|
|
1
4
|
import {
|
|
2
5
|
getCompilerContext
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-7PGHZOTU.mjs";
|
|
7
|
+
import "./chunk-VSRDBMDB.mjs";
|
|
8
|
+
import "./chunk-IY2OKZE6.mjs";
|
|
9
|
+
import "./chunk-YLNOOPZL.mjs";
|
|
6
10
|
import "./chunk-ZNKIYZRQ.mjs";
|
|
7
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-KHILYAA4.mjs";
|
|
8
12
|
|
|
9
13
|
// src/core.ts
|
|
10
14
|
import { defuOverrideArray } from "@weapp-tailwindcss/shared";
|
|
@@ -12,17 +16,25 @@ function createContext(options = {}) {
|
|
|
12
16
|
const opts = getCompilerContext(options);
|
|
13
17
|
const { templateHandler, styleHandler, jsHandler, twPatcher } = opts;
|
|
14
18
|
let runtimeSet = /* @__PURE__ */ new Set();
|
|
15
|
-
twPatcher.patch();
|
|
16
|
-
function transformWxss(rawCss, options2) {
|
|
17
|
-
|
|
19
|
+
const patchPromise = Promise.resolve(twPatcher.patch());
|
|
20
|
+
async function transformWxss(rawCss, options2) {
|
|
21
|
+
await patchPromise;
|
|
22
|
+
const result = await styleHandler(rawCss, defuOverrideArray(options2, {
|
|
18
23
|
isMainChunk: true
|
|
19
24
|
}));
|
|
25
|
+
runtimeSet = await collectRuntimeClassSet(twPatcher);
|
|
26
|
+
return result;
|
|
20
27
|
}
|
|
21
28
|
async function transformJs(rawJs, options2 = {}) {
|
|
22
|
-
|
|
29
|
+
await patchPromise;
|
|
30
|
+
runtimeSet = options2 && options2.runtimeSet ? options2.runtimeSet : await collectRuntimeClassSet(twPatcher);
|
|
23
31
|
return await jsHandler(rawJs, runtimeSet, options2);
|
|
24
32
|
}
|
|
25
|
-
function transformWxml(rawWxml, options2) {
|
|
33
|
+
async function transformWxml(rawWxml, options2) {
|
|
34
|
+
await patchPromise;
|
|
35
|
+
if (!options2?.runtimeSet && runtimeSet.size === 0) {
|
|
36
|
+
runtimeSet = await collectRuntimeClassSet(twPatcher);
|
|
37
|
+
}
|
|
26
38
|
return templateHandler(rawWxml, defuOverrideArray(options2, {
|
|
27
39
|
runtimeSet
|
|
28
40
|
}));
|
package/dist/css-macro.js
CHANGED
|
@@ -5,7 +5,7 @@ var _chunkNS3NEDWDjs = require('./chunk-NS3NEDWD.js');
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
8
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-E5PXIHDN.js');
|
|
9
9
|
|
|
10
10
|
// src/css-macro/index.ts
|
|
11
11
|
var _plugin = require('tailwindcss/plugin'); var _plugin2 = _interopRequireDefault(_plugin);
|
package/dist/css-macro.mjs
CHANGED
package/dist/defaults.d.mts
CHANGED
package/dist/defaults.d.ts
CHANGED
package/dist/defaults.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkI7FYDXN6js = require('./chunk-I7FYDXN6.js');
|
|
4
4
|
require('./chunk-UW3WHSZ5.js');
|
|
5
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-E5PXIHDN.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.getDefaultOptions =
|
|
8
|
+
exports.getDefaultOptions = _chunkI7FYDXN6js.getDefaultOptions;
|
package/dist/defaults.mjs
CHANGED
package/dist/escape.d.mts
CHANGED
package/dist/escape.d.ts
CHANGED
package/dist/escape.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunkDWAEHRHNjs = require('./chunk-DWAEHRHN.js');
|
|
4
|
+
require('./chunk-E5PXIHDN.js');
|
|
5
5
|
|
|
6
6
|
// src/escape.ts
|
|
7
7
|
var _escape = require('@weapp-core/escape');
|
|
@@ -10,4 +10,4 @@ var weappTwIgnore = String.raw;
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.escape =
|
|
13
|
+
exports.escape = _chunkDWAEHRHNjs.replaceWxml; exports.isAllowedClassName = _escape.isAllowedClassName; exports.weappTwIgnore = weappTwIgnore;
|
package/dist/escape.mjs
CHANGED
package/dist/gulp.d.mts
CHANGED
|
@@ -2,7 +2,6 @@ import { UserDefinedOptions, ITemplateHandlerOptions, CreateJsHandlerOptions } f
|
|
|
2
2
|
import stream from 'node:stream';
|
|
3
3
|
import { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
|
|
4
4
|
import '@babel/parser';
|
|
5
|
-
import '@weapp-tailwindcss/mangle';
|
|
6
5
|
import 'magic-string';
|
|
7
6
|
import 'postcss';
|
|
8
7
|
import 'tailwindcss-patch';
|
package/dist/gulp.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { UserDefinedOptions, ITemplateHandlerOptions, CreateJsHandlerOptions } f
|
|
|
2
2
|
import stream from 'node:stream';
|
|
3
3
|
import { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
|
|
4
4
|
import '@babel/parser';
|
|
5
|
-
import '@weapp-tailwindcss/mangle';
|
|
6
5
|
import 'magic-string';
|
|
7
6
|
import 'postcss';
|
|
8
7
|
import 'tailwindcss-patch';
|
package/dist/gulp.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
3
|
+
var _chunkM6DWZX4Hjs = require('./chunk-M6DWZX4H.js');
|
|
4
|
+
require('./chunk-LTJQUORK.js');
|
|
5
|
+
require('./chunk-FB5P4TRH.js');
|
|
6
|
+
require('./chunk-OVDIACVK.js');
|
|
7
|
+
require('./chunk-DWAEHRHN.js');
|
|
8
|
+
require('./chunk-AXLRUW5H.js');
|
|
9
|
+
require('./chunk-I7FYDXN6.js');
|
|
8
10
|
require('./chunk-UW3WHSZ5.js');
|
|
9
|
-
require('./chunk-
|
|
11
|
+
require('./chunk-E5PXIHDN.js');
|
|
10
12
|
|
|
11
13
|
|
|
12
|
-
exports.createPlugins =
|
|
14
|
+
exports.createPlugins = _chunkM6DWZX4Hjs.createPlugins;
|
package/dist/gulp.mjs
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPlugins
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-JG5LBGLH.mjs";
|
|
4
|
+
import "./chunk-RRHPTTCP.mjs";
|
|
5
|
+
import "./chunk-YPBRGP6K.mjs";
|
|
6
|
+
import "./chunk-7PGHZOTU.mjs";
|
|
7
|
+
import "./chunk-VSRDBMDB.mjs";
|
|
8
|
+
import "./chunk-IY2OKZE6.mjs";
|
|
9
|
+
import "./chunk-YLNOOPZL.mjs";
|
|
8
10
|
import "./chunk-ZNKIYZRQ.mjs";
|
|
9
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-KHILYAA4.mjs";
|
|
10
12
|
export {
|
|
11
13
|
createPlugins
|
|
12
14
|
};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export { createPlugins } from './gulp.mjs';
|
|
2
|
-
export { AppType, CreateJsHandlerOptions, IArbitraryValues, IBaseWebpackPlugin, ICommonReplaceOptions, ICustomAttributes, ICustomAttributesEntities, IJsHandlerOptions, ITemplateHandlerOptions,
|
|
2
|
+
export { AppType, CreateJsHandlerOptions, IArbitraryValues, IBaseWebpackPlugin, ICommonReplaceOptions, ICustomAttributes, ICustomAttributesEntities, IJsHandlerOptions, ITemplateHandlerOptions, InternalPatchResult, InternalPostcssOptions, InternalUserDefinedOptions, ItemOrItemArray, JsHandler, JsHandlerResult, JsModuleGraphOptions, LinkedJsModuleResult, TailwindcssPatcherLike, UserDefinedOptions } from './types.mjs';
|
|
3
3
|
export { UnifiedViteWeappTailwindcssPlugin } from './vite.mjs';
|
|
4
4
|
export { UnifiedWebpackPluginV5 } from './webpack.mjs';
|
|
5
5
|
export { CssPreflightOptions, IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
|
|
6
|
-
export { IMangleScopeContext } from '@weapp-tailwindcss/mangle';
|
|
7
6
|
import 'node:stream';
|
|
8
7
|
import '@babel/parser';
|
|
9
8
|
import 'magic-string';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export { createPlugins } from './gulp.js';
|
|
2
|
-
export { AppType, CreateJsHandlerOptions, IArbitraryValues, IBaseWebpackPlugin, ICommonReplaceOptions, ICustomAttributes, ICustomAttributesEntities, IJsHandlerOptions, ITemplateHandlerOptions,
|
|
2
|
+
export { AppType, CreateJsHandlerOptions, IArbitraryValues, IBaseWebpackPlugin, ICommonReplaceOptions, ICustomAttributes, ICustomAttributesEntities, IJsHandlerOptions, ITemplateHandlerOptions, InternalPatchResult, InternalPostcssOptions, InternalUserDefinedOptions, ItemOrItemArray, JsHandler, JsHandlerResult, JsModuleGraphOptions, LinkedJsModuleResult, TailwindcssPatcherLike, UserDefinedOptions } from './types.js';
|
|
3
3
|
export { UnifiedViteWeappTailwindcssPlugin } from './vite.js';
|
|
4
4
|
export { UnifiedWebpackPluginV5 } from './webpack.js';
|
|
5
5
|
export { CssPreflightOptions, IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
|
|
6
|
-
export { IMangleScopeContext } from '@weapp-tailwindcss/mangle';
|
|
7
6
|
import 'node:stream';
|
|
8
7
|
import '@babel/parser';
|
|
9
8
|
import 'magic-string';
|
package/dist/index.js
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-O2IOQ3BD.js');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk7CGHD2TIjs = require('./chunk-7CGHD2TI.js');
|
|
5
5
|
require('./chunk-6GP37C26.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkM6DWZX4Hjs = require('./chunk-M6DWZX4H.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkFVA7Y2YUjs = require('./chunk-FVA7Y2YU.js');
|
|
12
12
|
require('./chunk-WVKK6TBL.js');
|
|
13
|
-
require('./chunk-
|
|
13
|
+
require('./chunk-LTJQUORK.js');
|
|
14
|
+
require('./chunk-FB5P4TRH.js');
|
|
14
15
|
require('./chunk-OGROHM4L.js');
|
|
15
|
-
require('./chunk-
|
|
16
|
-
require('./chunk-
|
|
17
|
-
require('./chunk-
|
|
16
|
+
require('./chunk-OVDIACVK.js');
|
|
17
|
+
require('./chunk-DWAEHRHN.js');
|
|
18
|
+
require('./chunk-AXLRUW5H.js');
|
|
19
|
+
require('./chunk-I7FYDXN6.js');
|
|
18
20
|
require('./chunk-UW3WHSZ5.js');
|
|
19
|
-
require('./chunk-
|
|
21
|
+
require('./chunk-E5PXIHDN.js');
|
|
20
22
|
|
|
21
23
|
|
|
22
24
|
|
|
23
25
|
|
|
24
|
-
exports.UnifiedViteWeappTailwindcssPlugin =
|
|
26
|
+
exports.UnifiedViteWeappTailwindcssPlugin = _chunkFVA7Y2YUjs.UnifiedViteWeappTailwindcssPlugin; exports.UnifiedWebpackPluginV5 = _chunk7CGHD2TIjs.UnifiedWebpackPluginV5; exports.createPlugins = _chunkM6DWZX4Hjs.createPlugins;
|