weapp-tailwindcss 4.9.6 → 4.9.8-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-6HOJUSTX.mjs → chunk-2HORYQCB.mjs} +1 -1
- package/dist/{chunk-56QWZ2UM.js → chunk-35WZBSR2.js} +5 -5
- package/dist/{chunk-SPH6SCTM.mjs → chunk-47TVJCQM.mjs} +1 -1
- package/dist/{chunk-XD5AWWTB.mjs → chunk-5VEPZUTO.mjs} +4 -4
- package/dist/{chunk-W7ETGQW7.mjs → chunk-B76ICULV.mjs} +1 -1
- package/dist/{chunk-VPHA77FH.js → chunk-DOX3RXJ2.js} +2 -2
- package/dist/{chunk-HWF5U4CI.mjs → chunk-EGOFMIDI.mjs} +1 -1
- package/dist/{chunk-PUUBR36U.mjs → chunk-FY4CU2TB.mjs} +8 -6
- package/dist/{chunk-Y6F6NBA7.js → chunk-HAM3JEU2.js} +1 -1
- package/dist/{chunk-R3IC273Z.mjs → chunk-IPXH3S3C.mjs} +2 -2
- package/dist/{chunk-3J6TSML5.js → chunk-KBLYUEKE.js} +31 -31
- package/dist/{chunk-VI5WDH6L.js → chunk-KTUGHGKO.js} +7 -7
- package/dist/{chunk-COWTRJLM.js → chunk-KUFBWA2F.js} +15 -13
- package/dist/{chunk-GHWN5Y7Z.mjs → chunk-LACRPTD6.mjs} +2 -2
- package/dist/{chunk-FYYBY3VK.js → chunk-LBZCKOMT.js} +1 -1
- package/dist/{chunk-4RUFPPI6.js → chunk-PO3CCFU7.js} +4 -4
- package/dist/{chunk-FQUFI6M7.js → chunk-WRVALWQL.js} +23 -23
- package/dist/{chunk-F345SX2I.js → chunk-WVE6IP6G.js} +5 -5
- package/dist/cli.js +40 -40
- package/dist/cli.mjs +3 -3
- package/dist/core.d.mts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +11 -11
- package/dist/core.mjs +4 -4
- 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 +1 -1
- package/dist/defaults.d.ts +1 -1
- package/dist/defaults.js +3 -3
- package/dist/defaults.mjs +2 -2
- package/dist/gulp.d.mts +1 -1
- package/dist/gulp.d.ts +1 -1
- package/dist/gulp.js +7 -7
- package/dist/gulp.mjs +5 -5
- package/dist/{index-D4tYbWC6.d.ts → index-vGuAfNvT.d.mts} +12 -3
- package/dist/{index-D4tYbWC6.d.mts → index-vGuAfNvT.d.ts} +12 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -11
- package/dist/index.mjs +8 -8
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss-html-transform.mjs +1 -1
- package/dist/presets.d.mts +2 -1
- package/dist/presets.d.ts +2 -1
- package/dist/presets.js +6 -5
- package/dist/presets.mjs +2 -1
- package/dist/reset.js +1 -1
- package/dist/reset.mjs +1 -1
- package/dist/types.d.mts +2 -2
- package/dist/types.d.ts +2 -2
- package/dist/types.js +1 -1
- package/dist/types.mjs +1 -1
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +8 -8
- package/dist/vite.mjs +5 -5
- package/dist/webpack.d.mts +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +9 -9
- package/dist/webpack.mjs +6 -6
- package/dist/webpack4.d.mts +1 -1
- package/dist/webpack4.d.ts +1 -1
- package/dist/webpack4.js +34 -34
- package/dist/webpack4.mjs +5 -5
- package/package.json +5 -5
|
@@ -1,9 +1,9 @@
|
|
|
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 _chunkDOX3RXJ2js = require('./chunk-DOX3RXJ2.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkKUFBWA2Fjs = require('./chunk-KUFBWA2F.js');
|
|
7
7
|
|
|
8
8
|
// src/shared/mpx.ts
|
|
9
9
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
@@ -144,7 +144,7 @@ function rewriteTailwindcssRequestForCss(data, pkgDir, appType) {
|
|
|
144
144
|
if (!CSS_EXT_RE.test(normalizedIssuer)) {
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
|
-
const resolved =
|
|
147
|
+
const resolved = _chunkDOX3RXJ2js.resolveTailwindcssImport.call(void 0, request, pkgDir, { appType });
|
|
148
148
|
if (!resolved) {
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
@@ -154,8 +154,8 @@ function applyTailwindcssCssImportRewrite(compiler, options) {
|
|
|
154
154
|
if (!options.enabled) {
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
|
-
compiler.hooks.normalModuleFactory.tap(
|
|
158
|
-
factory.hooks.beforeResolve.tap(
|
|
157
|
+
compiler.hooks.normalModuleFactory.tap(_chunkKUFBWA2Fjs.pluginName, (factory) => {
|
|
158
|
+
factory.hooks.beforeResolve.tap(_chunkKUFBWA2Fjs.pluginName, (data) => {
|
|
159
159
|
rewriteTailwindcssRequestForCss(data, options.pkgDir, options.appType);
|
|
160
160
|
});
|
|
161
161
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@24.10.9__@swc+core@1.15.
|
|
1
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@24.10.9__@swc+core@1.15.11_@swc+_520f18ca95525f35cebc2ff127e63f14/node_modules/tsup/assets/esm_shims.js
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { fileURLToPath } from "url";
|
|
4
4
|
var getFilename = () => fileURLToPath(import.meta.url);
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
isMpx,
|
|
10
10
|
patchMpxLoaderResolve,
|
|
11
11
|
setupMpxTailwindcssRedirect
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-2HORYQCB.mjs";
|
|
13
13
|
import {
|
|
14
14
|
pushConcurrentTaskFactories,
|
|
15
15
|
resolveDisabledOptions,
|
|
@@ -22,20 +22,20 @@ import {
|
|
|
22
22
|
} from "./chunk-RRHPTTCP.mjs";
|
|
23
23
|
import {
|
|
24
24
|
setupPatchRecorder
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-B76ICULV.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-FY4CU2TB.mjs";
|
|
33
33
|
import {
|
|
34
34
|
getGroupedEntries
|
|
35
35
|
} from "./chunk-OOHJLO5M.mjs";
|
|
36
36
|
import {
|
|
37
37
|
__dirname
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-47TVJCQM.mjs";
|
|
39
39
|
|
|
40
40
|
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
41
41
|
import process3 from "process";
|
|
@@ -1,6 +1,6 @@
|
|
|
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 _chunkHAM3JEU2js = require('./chunk-HAM3JEU2.js');
|
|
4
4
|
|
|
5
5
|
// src/utils/disabled.ts
|
|
6
6
|
function resolveDisabledOptions(disabled) {
|
|
@@ -19,7 +19,7 @@ function resolveDisabledOptions(disabled) {
|
|
|
19
19
|
// src/utils/resolve-package.ts
|
|
20
20
|
var _module = require('module');
|
|
21
21
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
22
|
-
var require2 = _module.createRequire.call(void 0,
|
|
22
|
+
var require2 = _module.createRequire.call(void 0, _chunkHAM3JEU2js.importMetaUrl);
|
|
23
23
|
function resolvePackageDir(name) {
|
|
24
24
|
const pkgPath = require2.resolve(`${name}/package.json`);
|
|
25
25
|
return _path2.default.dirname(pkgPath);
|
|
@@ -99,7 +99,7 @@ function getDefaultOptions() {
|
|
|
99
99
|
},
|
|
100
100
|
disabledDefaultTemplateHandler: false,
|
|
101
101
|
cssSelectorReplacement: {
|
|
102
|
-
root: ["page", ".tw-root"],
|
|
102
|
+
root: ["page", ".tw-root", "wx-root-portal-content"],
|
|
103
103
|
universal: ["view", "text"]
|
|
104
104
|
},
|
|
105
105
|
babelParserOptions: {
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-7D27E7TU.mjs";
|
|
7
7
|
import {
|
|
8
8
|
getDefaultOptions
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-EGOFMIDI.mjs";
|
|
10
10
|
import {
|
|
11
11
|
defuOverrideArray,
|
|
12
12
|
isMap
|
|
@@ -192,7 +192,7 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
|
|
|
192
192
|
// package.json
|
|
193
193
|
var package_default = {
|
|
194
194
|
name: "weapp-tailwindcss",
|
|
195
|
-
version: "4.9.
|
|
195
|
+
version: "4.9.8-alpha.0",
|
|
196
196
|
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
197
|
author: "ice breaker <1324318532@qq.com>",
|
|
198
198
|
license: "MIT",
|
|
@@ -380,9 +380,9 @@ var package_default = {
|
|
|
380
380
|
},
|
|
381
381
|
dependencies: {
|
|
382
382
|
"@ast-core/escape": "~1.0.1",
|
|
383
|
-
"@babel/parser": "~7.
|
|
384
|
-
"@babel/traverse": "~7.
|
|
385
|
-
"@babel/types": "~7.
|
|
383
|
+
"@babel/parser": "~7.29.0",
|
|
384
|
+
"@babel/traverse": "~7.29.0",
|
|
385
|
+
"@babel/types": "~7.29.0",
|
|
386
386
|
"@tailwindcss-mangle/config": "^6.1.0",
|
|
387
387
|
"@vue/compiler-dom": "catalog:vue3",
|
|
388
388
|
"@vue/compiler-sfc": "catalog:vue3",
|
|
@@ -2746,6 +2746,7 @@ function createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions
|
|
|
2746
2746
|
cssPresetEnv,
|
|
2747
2747
|
uniAppX,
|
|
2748
2748
|
px2rpx,
|
|
2749
|
+
unitsToPx,
|
|
2749
2750
|
arbitraryValues,
|
|
2750
2751
|
jsPreserveClass,
|
|
2751
2752
|
babelParserOptions,
|
|
@@ -2770,7 +2771,8 @@ function createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions
|
|
|
2770
2771
|
cssPresetEnv,
|
|
2771
2772
|
uniAppX,
|
|
2772
2773
|
cssCalc: cssCalcOptions,
|
|
2773
|
-
px2rpx
|
|
2774
|
+
px2rpx,
|
|
2775
|
+
unitsToPx
|
|
2774
2776
|
});
|
|
2775
2777
|
const jsHandler2 = createJsHandler({
|
|
2776
2778
|
escapeMap,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@24.10.9__@swc+core@1.15.
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@24.10.9__@swc+core@1.15.11_@swc+_520f18ca95525f35cebc2ff127e63f14/node_modules/tsup/assets/cjs_shims.js
|
|
2
2
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
3
3
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
4
4
|
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-RRHPTTCP.mjs";
|
|
4
4
|
import {
|
|
5
5
|
setupPatchRecorder
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-B76ICULV.mjs";
|
|
7
7
|
import {
|
|
8
8
|
collectRuntimeClassSet,
|
|
9
9
|
createDebug,
|
|
10
10
|
getCompilerContext,
|
|
11
11
|
refreshTailwindRuntimeState
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FY4CU2TB.mjs";
|
|
13
13
|
|
|
14
14
|
// src/bundlers/gulp/index.ts
|
|
15
15
|
import { Buffer } from "buffer";
|
|
@@ -9,27 +9,27 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunk35WZBSR2js = require('./chunk-35WZBSR2.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkDOX3RXJ2js = require('./chunk-DOX3RXJ2.js');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunkWVE6IP6Gjs = require('./chunk-WVE6IP6G.js');
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkKUFBWA2Fjs = require('./chunk-KUFBWA2F.js');
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
@@ -51,10 +51,10 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
51
51
|
} = options;
|
|
52
52
|
const { Compilation, sources } = compiler.webpack;
|
|
53
53
|
const { ConcatSource } = sources;
|
|
54
|
-
compiler.hooks.compilation.tap(
|
|
54
|
+
compiler.hooks.compilation.tap(_chunkKUFBWA2Fjs.pluginName, (compilation) => {
|
|
55
55
|
compilation.hooks.processAssets.tapPromise(
|
|
56
56
|
{
|
|
57
|
-
name:
|
|
57
|
+
name: _chunkKUFBWA2Fjs.pluginName,
|
|
58
58
|
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
59
59
|
},
|
|
60
60
|
async (assets) => {
|
|
@@ -72,13 +72,13 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
72
72
|
const jsAssets = /* @__PURE__ */ new Map();
|
|
73
73
|
for (const [file] of entries) {
|
|
74
74
|
if (compilerOptions.jsMatcher(file) || compilerOptions.wxsMatcher(file)) {
|
|
75
|
-
const absolute =
|
|
75
|
+
const absolute = _chunkDOX3RXJ2js.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
76
76
|
jsAssets.set(absolute, file);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
const moduleGraphOptions = {
|
|
80
80
|
resolve(specifier, importer) {
|
|
81
|
-
return
|
|
81
|
+
return _chunkDOX3RXJ2js.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => jsAssets.has(candidate));
|
|
82
82
|
},
|
|
83
83
|
load: (id) => {
|
|
84
84
|
const assetName = jsAssets.get(id);
|
|
@@ -123,7 +123,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
123
123
|
const groupedEntries = _chunkDYLQ6UOIjs.getGroupedEntries.call(void 0, entries, compilerOptions);
|
|
124
124
|
await refreshRuntimeState(true);
|
|
125
125
|
await runtimeState.patchPromise;
|
|
126
|
-
const runtimeSet = await
|
|
126
|
+
const runtimeSet = await _chunkKUFBWA2Fjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
127
127
|
debug2("get runtimeSet, class count: %d", runtimeSet.size);
|
|
128
128
|
const tasks = [];
|
|
129
129
|
if (Array.isArray(groupedEntries.html)) {
|
|
@@ -160,12 +160,12 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
160
160
|
const jsTaskFactories = [];
|
|
161
161
|
if (Array.isArray(groupedEntries.js)) {
|
|
162
162
|
for (const [file] of groupedEntries.js) {
|
|
163
|
-
const cacheKey =
|
|
163
|
+
const cacheKey = _chunk35WZBSR2js.getCacheKey.call(void 0, file);
|
|
164
164
|
const asset = compilation.getAsset(file);
|
|
165
165
|
if (!asset) {
|
|
166
166
|
continue;
|
|
167
167
|
}
|
|
168
|
-
const absoluteFile =
|
|
168
|
+
const absoluteFile = _chunkDOX3RXJ2js.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
169
169
|
const initialSource = asset.source.source();
|
|
170
170
|
const initialRawSource = typeof initialSource === "string" ? initialSource : initialSource.toString();
|
|
171
171
|
jsTaskFactories.push(async () => {
|
|
@@ -240,7 +240,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
240
240
|
);
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
|
|
243
|
+
_chunkDOX3RXJ2js.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
|
|
244
244
|
await Promise.all(tasks);
|
|
245
245
|
debug2("end");
|
|
246
246
|
compilerOptions.onEnd();
|
|
@@ -265,9 +265,9 @@ function setupWebpackV5Loaders(options) {
|
|
|
265
265
|
getClassSetInLoader,
|
|
266
266
|
debug: debug2
|
|
267
267
|
} = options;
|
|
268
|
-
const isMpxApp =
|
|
268
|
+
const isMpxApp = _chunk35WZBSR2js.isMpx.call(void 0, appType);
|
|
269
269
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
270
|
-
|
|
270
|
+
_chunk35WZBSR2js.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
|
|
271
271
|
}
|
|
272
272
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
273
273
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -280,12 +280,12 @@ function setupWebpackV5Loaders(options) {
|
|
|
280
280
|
const classSetLoaderOptions = {
|
|
281
281
|
getClassSet: getClassSetInLoader
|
|
282
282
|
};
|
|
283
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
283
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunk35WZBSR2js.createLoaderAnchorFinders.call(void 0, appType);
|
|
284
284
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
285
285
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
286
286
|
} : void 0;
|
|
287
287
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
288
|
-
|
|
288
|
+
_chunk35WZBSR2js.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
289
289
|
}
|
|
290
290
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
291
291
|
loader: runtimeClassSetLoader,
|
|
@@ -305,17 +305,17 @@ function setupWebpackV5Loaders(options) {
|
|
|
305
305
|
};
|
|
306
306
|
};
|
|
307
307
|
const { NormalModule } = compiler.webpack;
|
|
308
|
-
compiler.hooks.compilation.tap(
|
|
309
|
-
NormalModule.getCompilationHooks(compilation).loader.tap(
|
|
308
|
+
compiler.hooks.compilation.tap(_chunkKUFBWA2Fjs.pluginName, (compilation) => {
|
|
309
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(_chunkKUFBWA2Fjs.pluginName, (_loaderContext, module) => {
|
|
310
310
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
311
311
|
if (!hasRuntimeLoader) {
|
|
312
312
|
return;
|
|
313
313
|
}
|
|
314
|
-
|
|
314
|
+
_chunk35WZBSR2js.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, shouldRewriteCssImports && isMpxApp);
|
|
315
315
|
const loaderEntries = module.loaders || [];
|
|
316
316
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
317
317
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
318
|
-
const isCssModule =
|
|
318
|
+
const isCssModule = _chunk35WZBSR2js.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
|
|
319
319
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
320
320
|
debug2("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
321
321
|
}
|
|
@@ -347,7 +347,7 @@ function setupWebpackV5Loaders(options) {
|
|
|
347
347
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
if (runtimeClassSetLoaderExists && !
|
|
350
|
+
if (runtimeClassSetLoaderExists && !_chunk35WZBSR2js.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
351
351
|
const classSetLoaderEntry = createRuntimeClassSetLoaderEntry();
|
|
352
352
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
353
353
|
if (anchorIndex === -1) {
|
|
@@ -362,11 +362,11 @@ function setupWebpackV5Loaders(options) {
|
|
|
362
362
|
}
|
|
363
363
|
|
|
364
364
|
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
365
|
-
var debug =
|
|
366
|
-
var weappTailwindcssPackageDir =
|
|
365
|
+
var debug = _chunkKUFBWA2Fjs.createDebug.call(void 0, );
|
|
366
|
+
var weappTailwindcssPackageDir = _chunkDOX3RXJ2js.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
367
367
|
var UnifiedWebpackPluginV5 = class {
|
|
368
368
|
constructor(options = {}) {
|
|
369
|
-
this.options =
|
|
369
|
+
this.options = _chunkKUFBWA2Fjs.getCompilerContext.call(void 0, options);
|
|
370
370
|
this.appType = this.options.appType;
|
|
371
371
|
}
|
|
372
372
|
apply(compiler) {
|
|
@@ -379,22 +379,22 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
379
379
|
twPatcher: initialTwPatcher,
|
|
380
380
|
refreshTailwindcssPatcher
|
|
381
381
|
} = this.options;
|
|
382
|
-
const disabledOptions =
|
|
382
|
+
const disabledOptions = _chunkDOX3RXJ2js.resolveDisabledOptions.call(void 0, disabled);
|
|
383
383
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
384
384
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
385
|
-
const isMpxApp =
|
|
385
|
+
const isMpxApp = _chunk35WZBSR2js.isMpx.call(void 0, this.appType);
|
|
386
386
|
if (shouldRewriteCssImports) {
|
|
387
|
-
|
|
387
|
+
_chunk35WZBSR2js.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
388
388
|
pkgDir: weappTailwindcssPackageDir,
|
|
389
389
|
enabled: true,
|
|
390
390
|
appType: this.appType
|
|
391
391
|
});
|
|
392
|
-
|
|
392
|
+
_chunk35WZBSR2js.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
393
393
|
}
|
|
394
394
|
if (disabledOptions.plugin) {
|
|
395
395
|
return;
|
|
396
396
|
}
|
|
397
|
-
const patchRecorderState =
|
|
397
|
+
const patchRecorderState = _chunkWVE6IP6Gjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
398
398
|
source: "runtime",
|
|
399
399
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
400
400
|
});
|
|
@@ -405,12 +405,12 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
405
405
|
onPatchCompleted: patchRecorderState.onPatchCompleted
|
|
406
406
|
};
|
|
407
407
|
const refreshRuntimeState = async (force) => {
|
|
408
|
-
await
|
|
408
|
+
await _chunkKUFBWA2Fjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
409
409
|
};
|
|
410
410
|
async function getClassSetInLoader() {
|
|
411
411
|
await refreshRuntimeState(true);
|
|
412
412
|
await runtimeState.patchPromise;
|
|
413
|
-
await
|
|
413
|
+
await _chunkKUFBWA2Fjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
414
414
|
}
|
|
415
415
|
onLoad();
|
|
416
416
|
setupWebpackV5Loaders({
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkWVE6IP6Gjs = require('./chunk-WVE6IP6G.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkKUFBWA2Fjs = require('./chunk-KUFBWA2F.js');
|
|
13
13
|
|
|
14
14
|
// src/bundlers/gulp/index.ts
|
|
15
15
|
var _buffer = require('buffer');
|
|
@@ -17,12 +17,12 @@ var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
|
17
17
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
18
18
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
19
19
|
var _stream = require('stream'); var _stream2 = _interopRequireDefault(_stream);
|
|
20
|
-
var debug =
|
|
20
|
+
var debug = _chunkKUFBWA2Fjs.createDebug.call(void 0, );
|
|
21
21
|
var Transform = _stream2.default.Transform;
|
|
22
22
|
function createPlugins(options = {}) {
|
|
23
|
-
const opts =
|
|
23
|
+
const opts = _chunkKUFBWA2Fjs.getCompilerContext.call(void 0, options);
|
|
24
24
|
const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
25
|
-
const patchRecorderState =
|
|
25
|
+
const patchRecorderState = _chunkWVE6IP6Gjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
26
26
|
source: "runtime",
|
|
27
27
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
28
28
|
});
|
|
@@ -36,7 +36,7 @@ function createPlugins(options = {}) {
|
|
|
36
36
|
const MODULE_EXTENSIONS = [".js", ".mjs", ".cjs", ".ts", ".tsx", ".jsx"];
|
|
37
37
|
let runtimeSetInitialized = false;
|
|
38
38
|
async function refreshRuntimeState(force) {
|
|
39
|
-
await
|
|
39
|
+
await _chunkKUFBWA2Fjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
40
40
|
}
|
|
41
41
|
async function refreshRuntimeSet(force = false) {
|
|
42
42
|
await refreshRuntimeState(force);
|
|
@@ -44,7 +44,7 @@ function createPlugins(options = {}) {
|
|
|
44
44
|
if (!force && runtimeSetInitialized && runtimeSet.size > 0) {
|
|
45
45
|
return runtimeSet;
|
|
46
46
|
}
|
|
47
|
-
runtimeSet = await
|
|
47
|
+
runtimeSet = await _chunkKUFBWA2Fjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force, skipRefresh: force });
|
|
48
48
|
runtimeSetInitialized = true;
|
|
49
49
|
return runtimeSet;
|
|
50
50
|
}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkPO3CCFU7js = require('./chunk-PO3CCFU7.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkLBZCKOMTjs = require('./chunk-LBZCKOMT.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -192,7 +192,7 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
|
|
|
192
192
|
// package.json
|
|
193
193
|
var package_default = {
|
|
194
194
|
name: "weapp-tailwindcss",
|
|
195
|
-
version: "4.9.
|
|
195
|
+
version: "4.9.8-alpha.0",
|
|
196
196
|
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
197
|
author: "ice breaker <1324318532@qq.com>",
|
|
198
198
|
license: "MIT",
|
|
@@ -380,9 +380,9 @@ var package_default = {
|
|
|
380
380
|
},
|
|
381
381
|
dependencies: {
|
|
382
382
|
"@ast-core/escape": "~1.0.1",
|
|
383
|
-
"@babel/parser": "~7.
|
|
384
|
-
"@babel/traverse": "~7.
|
|
385
|
-
"@babel/types": "~7.
|
|
383
|
+
"@babel/parser": "~7.29.0",
|
|
384
|
+
"@babel/traverse": "~7.29.0",
|
|
385
|
+
"@babel/types": "~7.29.0",
|
|
386
386
|
"@tailwindcss-mangle/config": "^6.1.0",
|
|
387
387
|
"@vue/compiler-dom": "catalog:vue3",
|
|
388
388
|
"@vue/compiler-sfc": "catalog:vue3",
|
|
@@ -549,7 +549,7 @@ function formatRelativeToBase(targetPath, baseDir) {
|
|
|
549
549
|
}
|
|
550
550
|
function resolveRecordLocation(baseDir) {
|
|
551
551
|
const normalizedBase = _path2.default.normalize(baseDir);
|
|
552
|
-
const packageRoot = _nullishCoalesce(
|
|
552
|
+
const packageRoot = _nullishCoalesce(_chunkPO3CCFU7js.findNearestPackageRoot.call(void 0, normalizedBase), () => ( normalizedBase));
|
|
553
553
|
const packageJsonPath = _path2.default.join(packageRoot, "package.json");
|
|
554
554
|
const hasPackageJson = _fs.existsSync.call(void 0, packageJsonPath);
|
|
555
555
|
const recordKeySource = hasPackageJson ? packageJsonPath : normalizedBase;
|
|
@@ -2746,6 +2746,7 @@ function createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions
|
|
|
2746
2746
|
cssPresetEnv,
|
|
2747
2747
|
uniAppX,
|
|
2748
2748
|
px2rpx,
|
|
2749
|
+
unitsToPx,
|
|
2749
2750
|
arbitraryValues,
|
|
2750
2751
|
jsPreserveClass,
|
|
2751
2752
|
babelParserOptions,
|
|
@@ -2770,7 +2771,8 @@ function createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions
|
|
|
2770
2771
|
cssPresetEnv,
|
|
2771
2772
|
uniAppX,
|
|
2772
2773
|
cssCalc: cssCalcOptions,
|
|
2773
|
-
px2rpx
|
|
2774
|
+
px2rpx,
|
|
2775
|
+
unitsToPx
|
|
2774
2776
|
});
|
|
2775
2777
|
const jsHandler2 = createJsHandler({
|
|
2776
2778
|
escapeMap,
|
|
@@ -2848,20 +2850,20 @@ async function clearTailwindcssPatcherCache(patcher, options) {
|
|
|
2848
2850
|
function createInternalCompilerContext(opts) {
|
|
2849
2851
|
const ctx = _chunkDYLQ6UOIjs.defuOverrideArray.call(void 0,
|
|
2850
2852
|
opts,
|
|
2851
|
-
|
|
2853
|
+
_chunkLBZCKOMTjs.getDefaultOptions.call(void 0, ),
|
|
2852
2854
|
{}
|
|
2853
2855
|
);
|
|
2854
2856
|
ctx.escapeMap = ctx.customReplaceDictionary;
|
|
2855
2857
|
applyLoggerLevel(ctx.logLevel);
|
|
2856
|
-
const twPatcher =
|
|
2858
|
+
const twPatcher = _chunkPO3CCFU7js.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
2857
2859
|
logTailwindcssTarget("runtime", twPatcher, ctx.tailwindcssBasedir);
|
|
2858
2860
|
if (_optionalChain([twPatcher, 'access', _95 => _95.packageInfo, 'optionalAccess', _96 => _96.version])) {
|
|
2859
2861
|
_logger.logger.success(`\u5F53\u524D\u4F7F\u7528 ${_logger.pc.cyanBright("Tailwind CSS")} \u7248\u672C\u4E3A: ${_logger.pc.underline(_logger.pc.bold(_logger.pc.green(twPatcher.packageInfo.version)))}`);
|
|
2860
2862
|
} else {
|
|
2861
2863
|
_logger.logger.warn(`${_logger.pc.cyanBright("Tailwind CSS")} \u672A\u5B89\u88C5\uFF0C\u5DF2\u8DF3\u8FC7\u7248\u672C\u68C0\u6D4B\u4E0E\u8865\u4E01\u5E94\u7528\u3002`);
|
|
2862
2864
|
}
|
|
2863
|
-
|
|
2864
|
-
const cssCalcOptions =
|
|
2865
|
+
_chunkPO3CCFU7js.warnMissingCssEntries.call(void 0, ctx, twPatcher);
|
|
2866
|
+
const cssCalcOptions = _chunkPO3CCFU7js.applyV4CssCalcDefaults.call(void 0, ctx.cssCalc, twPatcher);
|
|
2865
2867
|
ctx.cssCalc = cssCalcOptions;
|
|
2866
2868
|
const customAttributesEntities = toCustomAttributesEntities(ctx.customAttributes);
|
|
2867
2869
|
const { styleHandler, jsHandler: jsHandler2, templateHandler } = createHandlersFromContext(
|
|
@@ -2880,7 +2882,7 @@ function createInternalCompilerContext(opts) {
|
|
|
2880
2882
|
await clearTailwindcssPatcherCache(previousPatcher);
|
|
2881
2883
|
}
|
|
2882
2884
|
invalidateRuntimeClassSet(previousPatcher);
|
|
2883
|
-
const nextPatcher =
|
|
2885
|
+
const nextPatcher = _chunkPO3CCFU7js.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
2884
2886
|
Object.assign(previousPatcher, nextPatcher);
|
|
2885
2887
|
ctx.twPatcher = previousPatcher;
|
|
2886
2888
|
return previousPatcher;
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-RRHPTTCP.mjs";
|
|
13
13
|
import {
|
|
14
14
|
setupPatchRecorder
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-B76ICULV.mjs";
|
|
16
16
|
import {
|
|
17
17
|
collectRuntimeClassSet,
|
|
18
18
|
createAttributeMatcher,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
replaceWxml,
|
|
24
24
|
toCustomAttributesEntities,
|
|
25
25
|
vitePluginName
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-FY4CU2TB.mjs";
|
|
27
27
|
import {
|
|
28
28
|
getGroupedEntries,
|
|
29
29
|
resolveUniUtsPlatform
|
|
@@ -99,7 +99,7 @@ function getDefaultOptions() {
|
|
|
99
99
|
},
|
|
100
100
|
disabledDefaultTemplateHandler: false,
|
|
101
101
|
cssSelectorReplacement: {
|
|
102
|
-
root: ["page", ".tw-root"],
|
|
102
|
+
root: ["page", ".tw-root", "wx-root-portal-content"],
|
|
103
103
|
universal: ["view", "text"]
|
|
104
104
|
},
|
|
105
105
|
babelParserOptions: {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkHAM3JEU2js = require('./chunk-HAM3JEU2.js');
|
|
7
7
|
|
|
8
8
|
// src/logger/index.ts
|
|
9
9
|
var _logger = require('@weapp-tailwindcss/logger');
|
|
@@ -318,7 +318,7 @@ function resolveModuleFromPaths(specifier, paths) {
|
|
|
318
318
|
return void 0;
|
|
319
319
|
}
|
|
320
320
|
try {
|
|
321
|
-
const req = _module.createRequire.call(void 0,
|
|
321
|
+
const req = _module.createRequire.call(void 0, _chunkHAM3JEU2js.importMetaUrl);
|
|
322
322
|
return req.resolve(specifier, { paths });
|
|
323
323
|
} catch (e3) {
|
|
324
324
|
return void 0;
|
|
@@ -373,11 +373,11 @@ function createDefaultResolvePaths(basedir) {
|
|
|
373
373
|
const cwd = _process2.default.cwd();
|
|
374
374
|
appendNodeModules(paths, cwd);
|
|
375
375
|
try {
|
|
376
|
-
const modulePath = _url.fileURLToPath.call(void 0,
|
|
376
|
+
const modulePath = _url.fileURLToPath.call(void 0, _chunkHAM3JEU2js.importMetaUrl);
|
|
377
377
|
const candidate = _fs.existsSync.call(void 0, modulePath) && !_path2.default.extname(modulePath) ? modulePath : _path2.default.dirname(modulePath);
|
|
378
378
|
paths.add(candidate);
|
|
379
379
|
} catch (e4) {
|
|
380
|
-
paths.add(
|
|
380
|
+
paths.add(_chunkHAM3JEU2js.importMetaUrl);
|
|
381
381
|
}
|
|
382
382
|
if (paths.size === 0) {
|
|
383
383
|
fallbackCandidates = fallbackCandidates.filter(Boolean);
|