weapp-tailwindcss 5.0.0-next.26 → 5.0.0-next.28
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/{auto-CqyEtds4.js → auto-TH1jG2UW.js} +2 -2
- package/dist/{auto-CsWz6lsU.mjs → auto-XyKTOP7B.mjs} +1 -1
- package/dist/{bundle-state-CWcrb3mH.mjs → bundle-state-Bi-cQua6.mjs} +1 -1
- package/dist/{bundle-state-uCtqRm0p.js → bundle-state-Ct_8GcSR.js} +2 -2
- package/dist/bundlers/vite/index.d.ts +5 -2
- package/dist/bundlers/vite/source-candidates.d.ts +3 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +1 -1
- package/dist/{chunk-8l464Juk.js → chunk-C5U5_Hdc.js} +14 -0
- package/dist/cli.js +5 -6
- package/dist/cli.mjs +5 -6
- package/dist/core.js +1 -2
- package/dist/core.mjs +1 -1
- package/dist/css-macro/postcss.js +1 -1
- package/dist/css-macro/postcss.mjs +1 -1
- package/dist/css-macro.js +4 -4
- package/dist/css-macro.mjs +3 -3
- package/dist/{defaults-B-1EEhdL.mjs → defaults-8xrgzxFY.mjs} +1 -1
- package/dist/{defaults-C10hYUch.js → defaults-zKUH2mDe.js} +1 -2
- package/dist/defaults.js +1 -1
- package/dist/defaults.mjs +1 -1
- package/dist/{generator-BH6a0xuB.js → generator-CrU-Ghc1.js} +10 -3
- package/dist/{generator-iI_265gt.mjs → generator-Qw-tZ0Z2.mjs} +9 -2
- package/dist/generator.js +2 -3
- package/dist/generator.mjs +2 -2
- package/dist/gulp.js +6 -6
- package/dist/gulp.mjs +5 -5
- package/dist/{incremental-runtime-class-set-ECHyKwUL.mjs → incremental-runtime-class-set-CYkXVVCL.mjs} +48 -14
- package/dist/{incremental-runtime-class-set-mY0v1k-Y.js → incremental-runtime-class-set-DPQEzllt.js} +48 -14
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -6
- package/dist/index.mjs +5 -5
- package/dist/{postcss-DJoU--Z-.mjs → postcss-C6zOQqlL.mjs} +2 -2
- package/dist/{postcss-DEEAZ8J5.js → postcss-DAWf9D3C.js} +3 -3
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss.js +1 -1
- package/dist/postcss.mjs +1 -1
- package/dist/{precheck-BI8oBeUg.mjs → precheck-D7K12zeX.mjs} +41 -17
- package/dist/{precheck-DLJg0_pu.js → precheck-D7gJSmJz.js} +37 -13
- package/dist/presets.js +5 -5
- package/dist/presets.mjs +4 -4
- package/dist/reset.js +1 -1
- package/dist/{source-candidates-DkScNh9A.mjs → source-candidates-CX2ozpKM.mjs} +49 -7
- package/dist/{source-candidates-mfvC9gMc.js → source-candidates-DNM8iwXW.js} +50 -8
- package/dist/{tailwindcss-Cm93idme.js → tailwindcss-B-e2RiXr.js} +3 -3
- package/dist/{tailwindcss-DFa5Yes8.mjs → tailwindcss-C7dJHZ0G.mjs} +2 -2
- package/dist/{utils-CSA174-I.js → utils-D7Ygohep.js} +1 -1
- package/dist/{v3-engine-CGsbY81C.js → v3-engine-CHItlVq5.js} +12 -4
- package/dist/{v3-engine-CPJ9uGyr.mjs → v3-engine-DcvCCHfs.mjs} +11 -3
- package/dist/vite-CHYG-Lf6.js +24439 -0
- package/dist/vite-CmimsYBm.mjs +24425 -0
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +54 -13
- package/dist/weapp-tw-runtime-classset-loader.js +1 -1
- package/dist/{webpack-CfcuDhQ8.js → webpack-BguN8tQa.js} +16 -14
- package/dist/{webpack-D--XZMBB.mjs → webpack-ejGMOruE.mjs} +15 -13
- package/dist/webpack.d.ts +1 -3
- package/dist/webpack.js +3 -4
- package/dist/webpack.mjs +2 -2
- package/package.json +7 -7
- package/dist/vite-BM_ksf1q.js +0 -2537
- package/dist/vite-CqEF-Wx5.mjs +0 -2523
- /package/dist/{logger-Dr7IvyH2.mjs → logger-BNzxZbZj.mjs} +0 -0
- /package/dist/{logger-Cdzl3p8j.js → logger-TlKT3xmR.js} +0 -0
- /package/dist/{postcss-BzaRjBL0.mjs → postcss-C7BMYpEF.mjs} +0 -0
- /package/dist/{postcss-BwW8zO24.js → postcss-CiYLsqZn.js} +0 -0
- /package/dist/{runtime-registry-CdCV3Opt.js → runtime-registry-DpcR3IHI.js} +0 -0
- /package/dist/{utils-B2SJgA1L.mjs → utils-DsaS975I.mjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_chunk = require("./chunk-
|
|
2
|
-
const require_postcss = require("./postcss-
|
|
1
|
+
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
+
const require_postcss = require("./postcss-CiYLsqZn.js");
|
|
3
3
|
let postcss = require("postcss");
|
|
4
4
|
postcss = require_chunk.__toESM(postcss);
|
|
5
5
|
//#region src/css-macro/auto.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as traverse, h as babelParse, o as Parser } from "./precheck-D7K12zeX.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import process from "node:process";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_chunk = require("./chunk-
|
|
2
|
-
const require_precheck = require("./precheck-
|
|
1
|
+
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
+
const require_precheck = require("./precheck-D7gJSmJz.js");
|
|
3
3
|
let node_module = require("node:module");
|
|
4
4
|
let node_path = require("node:path");
|
|
5
5
|
node_path = require_chunk.__toESM(node_path);
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import type { Plugin } from 'vite';
|
|
2
1
|
import type { UserDefinedOptions } from '../../types';
|
|
3
|
-
export
|
|
2
|
+
export interface WeappTailwindcssVitePlugin {
|
|
3
|
+
name: string;
|
|
4
|
+
[hook: string]: any;
|
|
5
|
+
}
|
|
6
|
+
export declare function WeappTailwindcss(options?: UserDefinedOptions): WeappTailwindcssVitePlugin[] | undefined;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { TailwindInlineSourceCandidates, TailwindSourceEntry } from '../../tailwindcss/source-scan';
|
|
2
2
|
export interface SourceCandidateCollector {
|
|
3
3
|
sync: (id: string, source: string) => Promise<void>;
|
|
4
|
+
syncCss: (id: string, source: string) => Promise<void>;
|
|
4
5
|
merge: (id: string, source: string) => Promise<void>;
|
|
5
6
|
syncFile: (id: string) => Promise<void>;
|
|
6
7
|
syncCurrentFile: (id: string) => Promise<void>;
|
|
@@ -15,6 +16,7 @@ export interface SourceCandidateCollector {
|
|
|
15
16
|
}
|
|
16
17
|
export interface SourceCandidateCollectorSnapshot {
|
|
17
18
|
candidatesById: Array<[string, string[]]>;
|
|
19
|
+
cssCandidatesById?: Array<[string, string[]]> | undefined;
|
|
18
20
|
scanCandidatesById?: Array<[string, string[]]> | undefined;
|
|
19
21
|
transformCandidatesById?: Array<[string, string[]]> | undefined;
|
|
20
22
|
inlineExcludedCandidates: string[];
|
|
@@ -24,6 +26,7 @@ interface ScanSourceCandidateRootOptions {
|
|
|
24
26
|
root: string;
|
|
25
27
|
outDir?: string | undefined;
|
|
26
28
|
entries?: TailwindSourceEntry[] | undefined;
|
|
29
|
+
explicit?: boolean | undefined;
|
|
27
30
|
}
|
|
28
31
|
export declare function isSourceCandidateRequest(id: string): boolean;
|
|
29
32
|
export declare function createSourceCandidateCollector(): SourceCandidateCollector;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Compiler } from 'webpack';
|
|
2
2
|
import type { AppType, IBaseWebpackPlugin, InternalUserDefinedOptions, UserDefinedOptions } from '../../../types';
|
|
3
3
|
export declare const weappTailwindcssPackageDir: string;
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class WeappTailwindcss implements IBaseWebpackPlugin {
|
|
5
5
|
options: InternalUserDefinedOptions;
|
|
6
6
|
appType?: AppType;
|
|
7
7
|
private hasInitialTailwindCssRoots;
|
|
@@ -5,6 +5,8 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
9
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
8
10
|
var __copyProps = (to, from, except, desc) => {
|
|
9
11
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
12
|
key = keys[i];
|
|
@@ -20,6 +22,18 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
20
22
|
enumerable: true
|
|
21
23
|
}) : target, mod));
|
|
22
24
|
//#endregion
|
|
25
|
+
Object.defineProperty(exports, "__commonJSMin", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function() {
|
|
28
|
+
return __commonJSMin;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "__esmMin", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function() {
|
|
34
|
+
return __esmMin;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
23
37
|
Object.defineProperty(exports, "__toESM", {
|
|
24
38
|
enumerable: true,
|
|
25
39
|
get: function() {
|
package/dist/cli.js
CHANGED
|
@@ -1349,7 +1349,7 @@ function walkEvalExpression(path, options, updater, handler) {
|
|
|
1349
1349
|
}
|
|
1350
1350
|
}
|
|
1351
1351
|
//#endregion
|
|
1352
|
-
//#region \0@oxc-project+runtime@0.
|
|
1352
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/typeof.js
|
|
1353
1353
|
function _typeof(o) {
|
|
1354
1354
|
"@babel/helpers - typeof";
|
|
1355
1355
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -1359,7 +1359,7 @@ function _typeof(o) {
|
|
|
1359
1359
|
}, _typeof(o);
|
|
1360
1360
|
}
|
|
1361
1361
|
//#endregion
|
|
1362
|
-
//#region \0@oxc-project+runtime@0.
|
|
1362
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPrimitive.js
|
|
1363
1363
|
function toPrimitive(t, r) {
|
|
1364
1364
|
if ("object" != _typeof(t) || !t) return t;
|
|
1365
1365
|
var e = t[Symbol.toPrimitive];
|
|
@@ -1371,13 +1371,13 @@ function toPrimitive(t, r) {
|
|
|
1371
1371
|
return ("string" === r ? String : Number)(t);
|
|
1372
1372
|
}
|
|
1373
1373
|
//#endregion
|
|
1374
|
-
//#region \0@oxc-project+runtime@0.
|
|
1374
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPropertyKey.js
|
|
1375
1375
|
function toPropertyKey(t) {
|
|
1376
1376
|
var i = toPrimitive(t, "string");
|
|
1377
1377
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
1378
1378
|
}
|
|
1379
1379
|
//#endregion
|
|
1380
|
-
//#region \0@oxc-project+runtime@0.
|
|
1380
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/defineProperty.js
|
|
1381
1381
|
function _defineProperty(e, r, t) {
|
|
1382
1382
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
1383
1383
|
value: t,
|
|
@@ -2096,9 +2096,8 @@ function jsHandler(rawSource, options) {
|
|
|
2096
2096
|
if (shouldWrapExpression) {
|
|
2097
2097
|
const start = 0;
|
|
2098
2098
|
const end = source.length;
|
|
2099
|
-
const prefixLength = 2;
|
|
2100
2099
|
const suffixLength = 2;
|
|
2101
|
-
ms.remove(start,
|
|
2100
|
+
ms.remove(start, 2);
|
|
2102
2101
|
ms.remove(end - suffixLength, end);
|
|
2103
2102
|
}
|
|
2104
2103
|
const result = { code: ms.toString() };
|
package/dist/cli.mjs
CHANGED
|
@@ -1320,7 +1320,7 @@ function walkEvalExpression(path, options, updater, handler) {
|
|
|
1320
1320
|
}
|
|
1321
1321
|
}
|
|
1322
1322
|
//#endregion
|
|
1323
|
-
//#region \0@oxc-project+runtime@0.
|
|
1323
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/typeof.js
|
|
1324
1324
|
function _typeof(o) {
|
|
1325
1325
|
"@babel/helpers - typeof";
|
|
1326
1326
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -1330,7 +1330,7 @@ function _typeof(o) {
|
|
|
1330
1330
|
}, _typeof(o);
|
|
1331
1331
|
}
|
|
1332
1332
|
//#endregion
|
|
1333
|
-
//#region \0@oxc-project+runtime@0.
|
|
1333
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPrimitive.js
|
|
1334
1334
|
function toPrimitive(t, r) {
|
|
1335
1335
|
if ("object" != _typeof(t) || !t) return t;
|
|
1336
1336
|
var e = t[Symbol.toPrimitive];
|
|
@@ -1342,13 +1342,13 @@ function toPrimitive(t, r) {
|
|
|
1342
1342
|
return ("string" === r ? String : Number)(t);
|
|
1343
1343
|
}
|
|
1344
1344
|
//#endregion
|
|
1345
|
-
//#region \0@oxc-project+runtime@0.
|
|
1345
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPropertyKey.js
|
|
1346
1346
|
function toPropertyKey(t) {
|
|
1347
1347
|
var i = toPrimitive(t, "string");
|
|
1348
1348
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
1349
1349
|
}
|
|
1350
1350
|
//#endregion
|
|
1351
|
-
//#region \0@oxc-project+runtime@0.
|
|
1351
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/defineProperty.js
|
|
1352
1352
|
function _defineProperty(e, r, t) {
|
|
1353
1353
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
1354
1354
|
value: t,
|
|
@@ -2067,9 +2067,8 @@ function jsHandler(rawSource, options) {
|
|
|
2067
2067
|
if (shouldWrapExpression) {
|
|
2068
2068
|
const start = 0;
|
|
2069
2069
|
const end = source.length;
|
|
2070
|
-
const prefixLength = 2;
|
|
2071
2070
|
const suffixLength = 2;
|
|
2072
|
-
ms.remove(start,
|
|
2071
|
+
ms.remove(start, 2);
|
|
2073
2072
|
ms.remove(end - suffixLength, end);
|
|
2074
2073
|
}
|
|
2075
2074
|
const result = { code: ms.toString() };
|
package/dist/core.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("./
|
|
3
|
-
const require_precheck = require("./precheck-DLJg0_pu.js");
|
|
2
|
+
const require_precheck = require("./precheck-D7gJSmJz.js");
|
|
4
3
|
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
5
4
|
//#region src/core.ts
|
|
6
5
|
const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
|
package/dist/core.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as ensureRuntimeClassSet, n as getCompilerContext, t as shouldSkipJsTransform, y as createTailwindRuntimeReadyPromise } from "./precheck-D7K12zeX.mjs";
|
|
2
2
|
import { defuOverrideArray } from "@weapp-tailwindcss/shared";
|
|
3
3
|
//#region src/core.ts
|
|
4
4
|
const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
|
|
@@ -2,6 +2,6 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_postcss = require("../postcss-
|
|
5
|
+
const require_postcss = require("../postcss-CiYLsqZn.js");
|
|
6
6
|
exports.CSS_MACRO_POSTCSS_PLUGIN_NAME = require_postcss.CSS_MACRO_POSTCSS_PLUGIN_NAME;
|
|
7
7
|
exports.default = require_postcss.creator;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as creator, t as CSS_MACRO_POSTCSS_PLUGIN_NAME } from "../postcss-
|
|
1
|
+
import { n as creator, t as CSS_MACRO_POSTCSS_PLUGIN_NAME } from "../postcss-C7BMYpEF.mjs";
|
|
2
2
|
export { CSS_MACRO_POSTCSS_PLUGIN_NAME, creator as default };
|
package/dist/css-macro.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_chunk = require("./chunk-
|
|
2
|
-
const require_postcss = require("./postcss-
|
|
3
|
-
const require_auto = require("./auto-
|
|
4
|
-
require("./utils-
|
|
1
|
+
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
+
const require_postcss = require("./postcss-CiYLsqZn.js");
|
|
3
|
+
const require_auto = require("./auto-TH1jG2UW.js");
|
|
4
|
+
require("./utils-D7Ygohep.js");
|
|
5
5
|
let tailwindcss_plugin = require("tailwindcss/plugin");
|
|
6
6
|
tailwindcss_plugin = require_chunk.__toESM(tailwindcss_plugin);
|
|
7
7
|
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
package/dist/css-macro.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as createNegativeConditionalAtRule, r as createConditionalAtRule } from "./postcss-
|
|
2
|
-
import { i as markCssMacroPlugin } from "./auto-
|
|
3
|
-
import { t as defu } from "./utils-
|
|
1
|
+
import { i as createNegativeConditionalAtRule, r as createConditionalAtRule } from "./postcss-C7BMYpEF.mjs";
|
|
2
|
+
import { i as markCssMacroPlugin } from "./auto-XyKTOP7B.mjs";
|
|
3
|
+
import { t as defu } from "./utils-DsaS975I.mjs";
|
|
4
4
|
import plugin from "tailwindcss/plugin";
|
|
5
5
|
//#region src/css-macro/index.ts
|
|
6
6
|
const defaultOptions = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as noop } from "./utils-
|
|
1
|
+
import { a as noop } from "./utils-DsaS975I.mjs";
|
|
2
2
|
import { MappingChars2String, isAllowedClassName } from "@weapp-core/escape";
|
|
3
3
|
//#region src/js/babel/cache-options.ts
|
|
4
4
|
const DEFAULT_PARSE_CACHE_MAX_SOURCE_LENGTH = 5e4;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
require("./
|
|
2
|
-
require("./utils-CSA174-I.js");
|
|
1
|
+
require("./utils-D7Ygohep.js");
|
|
3
2
|
let _weapp_core_escape = require("@weapp-core/escape");
|
|
4
3
|
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
5
4
|
//#region src/js/babel/cache-options.ts
|
package/dist/defaults.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_defaults = require("./defaults-
|
|
2
|
+
const require_defaults = require("./defaults-zKUH2mDe.js");
|
|
3
3
|
exports.TAILWIND_V3_CSS_PREFLIGHT = require_defaults.TAILWIND_V3_CSS_PREFLIGHT;
|
|
4
4
|
exports.TAILWIND_V4_CSS_PREFLIGHT = require_defaults.TAILWIND_V4_CSS_PREFLIGHT;
|
|
5
5
|
exports.getDefaultCssPreflight = require_defaults.getDefaultCssPreflight;
|
package/dist/defaults.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as resolveDefaultCssPreflight, i as getDefaultOptions, n as TAILWIND_V4_CSS_PREFLIGHT, r as getDefaultCssPreflight, t as TAILWIND_V3_CSS_PREFLIGHT } from "./defaults-
|
|
1
|
+
import { a as resolveDefaultCssPreflight, i as getDefaultOptions, n as TAILWIND_V4_CSS_PREFLIGHT, r as getDefaultCssPreflight, t as TAILWIND_V3_CSS_PREFLIGHT } from "./defaults-8xrgzxFY.mjs";
|
|
2
2
|
export { TAILWIND_V3_CSS_PREFLIGHT, TAILWIND_V4_CSS_PREFLIGHT, getDefaultCssPreflight, getDefaultOptions, resolveDefaultCssPreflight };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_chunk = require("./chunk-
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
1
|
+
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
+
const require_v3_engine = require("./v3-engine-CHItlVq5.js");
|
|
3
3
|
let node_process = require("node:process");
|
|
4
4
|
node_process = require_chunk.__toESM(node_process);
|
|
5
5
|
//#region src/generator/options.ts
|
|
@@ -16,6 +16,13 @@ function isUniWebPlatform(value) {
|
|
|
16
16
|
const normalized = value?.trim().toLowerCase();
|
|
17
17
|
return normalized === "h5" || normalized?.startsWith("web") === true;
|
|
18
18
|
}
|
|
19
|
+
function isUniAppWebViewPlatform(value) {
|
|
20
|
+
const normalized = value?.trim().toLowerCase();
|
|
21
|
+
return normalized === "app" || normalized === "app-plus";
|
|
22
|
+
}
|
|
23
|
+
function isUniNativeAppPlatform(value) {
|
|
24
|
+
return (value?.trim().toLowerCase())?.startsWith("app-") === true;
|
|
25
|
+
}
|
|
19
26
|
function isMpxWebPlatform(value) {
|
|
20
27
|
return value?.trim().toLowerCase() === "web";
|
|
21
28
|
}
|
|
@@ -24,7 +31,7 @@ function inferGeneratorTargetFromEnv() {
|
|
|
24
31
|
const target = normalizeGeneratorTargetValue(getEnvValue(key));
|
|
25
32
|
if (target !== void 0) return target;
|
|
26
33
|
}
|
|
27
|
-
if (uniWebPlatformEnvKeys.some((key) => isUniWebPlatform(getEnvValue(key))) || mpxWebPlatformEnvKeys.some((key) => isMpxWebPlatform(getEnvValue(key))) || getEnvValue("TARO_ENV") === "h5") return "web";
|
|
34
|
+
if (uniWebPlatformEnvKeys.some((key) => isUniWebPlatform(getEnvValue(key))) || isUniAppWebViewPlatform(getEnvValue("UNI_PLATFORM")) && !isUniNativeAppPlatform(getEnvValue("UNI_UTS_PLATFORM")) || mpxWebPlatformEnvKeys.some((key) => isMpxWebPlatform(getEnvValue(key))) || getEnvValue("TARO_ENV") === "h5") return "web";
|
|
28
35
|
return "weapp";
|
|
29
36
|
}
|
|
30
37
|
function normalizeWeappTailwindcssGeneratorOptions(options) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as createTailwindV4Engine, i as createTailwindV3Engine, n as resolveTailwindV3SourceFromPatcher, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-
|
|
1
|
+
import { C as createTailwindV4Engine, i as createTailwindV3Engine, n as resolveTailwindV3SourceFromPatcher, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-DcvCCHfs.mjs";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
//#region src/generator/options.ts
|
|
4
4
|
const explicitGeneratorTargetEnvKeys = ["WEAPP_TW_TARGET", "WEAPP_TAILWINDCSS_TARGET"];
|
|
@@ -14,6 +14,13 @@ function isUniWebPlatform(value) {
|
|
|
14
14
|
const normalized = value?.trim().toLowerCase();
|
|
15
15
|
return normalized === "h5" || normalized?.startsWith("web") === true;
|
|
16
16
|
}
|
|
17
|
+
function isUniAppWebViewPlatform(value) {
|
|
18
|
+
const normalized = value?.trim().toLowerCase();
|
|
19
|
+
return normalized === "app" || normalized === "app-plus";
|
|
20
|
+
}
|
|
21
|
+
function isUniNativeAppPlatform(value) {
|
|
22
|
+
return (value?.trim().toLowerCase())?.startsWith("app-") === true;
|
|
23
|
+
}
|
|
17
24
|
function isMpxWebPlatform(value) {
|
|
18
25
|
return value?.trim().toLowerCase() === "web";
|
|
19
26
|
}
|
|
@@ -22,7 +29,7 @@ function inferGeneratorTargetFromEnv() {
|
|
|
22
29
|
const target = normalizeGeneratorTargetValue(getEnvValue(key));
|
|
23
30
|
if (target !== void 0) return target;
|
|
24
31
|
}
|
|
25
|
-
if (uniWebPlatformEnvKeys.some((key) => isUniWebPlatform(getEnvValue(key))) || mpxWebPlatformEnvKeys.some((key) => isMpxWebPlatform(getEnvValue(key))) || getEnvValue("TARO_ENV") === "h5") return "web";
|
|
32
|
+
if (uniWebPlatformEnvKeys.some((key) => isUniWebPlatform(getEnvValue(key))) || isUniAppWebViewPlatform(getEnvValue("UNI_PLATFORM")) && !isUniNativeAppPlatform(getEnvValue("UNI_UTS_PLATFORM")) || mpxWebPlatformEnvKeys.some((key) => isMpxWebPlatform(getEnvValue(key))) || getEnvValue("TARO_ENV") === "h5") return "web";
|
|
26
33
|
return "weapp";
|
|
27
34
|
}
|
|
28
35
|
function normalizeWeappTailwindcssGeneratorOptions(options) {
|
package/dist/generator.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("./
|
|
3
|
-
const
|
|
4
|
-
const require_generator = require("./generator-BH6a0xuB.js");
|
|
2
|
+
const require_v3_engine = require("./v3-engine-CHItlVq5.js");
|
|
3
|
+
const require_generator = require("./generator-CrU-Ghc1.js");
|
|
5
4
|
let tailwindcss_patch = require("tailwindcss-patch");
|
|
6
5
|
exports.createWeappTailwindcssGenerator = require_generator.createWeappTailwindcssGenerator;
|
|
7
6
|
exports.createWeappTailwindcssGeneratorFromPatcher = require_generator.createWeappTailwindcssGeneratorFromPatcher;
|
package/dist/generator.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { S as resolveTailwindV4SourceOptionsFromPatcher, T as transformTailwindV4CssToWeapp, a as transformTailwindV3CssByTarget, b as resolveTailwindV4SourceFromPatchOptions, n as resolveTailwindV3SourceFromPatcher, o as transformTailwindV3CssToWeapp, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, w as transformTailwindV4CssByTarget, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source } from "./v3-engine-
|
|
2
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromPatcher, r as resolveTailwindSourceFromPatcher, t as createWeappTailwindcssGenerator } from "./generator-
|
|
1
|
+
import { S as resolveTailwindV4SourceOptionsFromPatcher, T as transformTailwindV4CssToWeapp, a as transformTailwindV3CssByTarget, b as resolveTailwindV4SourceFromPatchOptions, n as resolveTailwindV3SourceFromPatcher, o as transformTailwindV3CssToWeapp, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, w as transformTailwindV4CssByTarget, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source } from "./v3-engine-DcvCCHfs.mjs";
|
|
2
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromPatcher, r as resolveTailwindSourceFromPatcher, t as createWeappTailwindcssGenerator } from "./generator-Qw-tZ0Z2.mjs";
|
|
3
3
|
export { createWeappTailwindcssGenerator, createWeappTailwindcssGeneratorFromPatcher, normalizeWeappTailwindcssGeneratorOptions, resolveTailwindSourceFromPatcher, resolveTailwindV3Source, resolveTailwindV3SourceFromPatcher, resolveTailwindV3SourceOptionsFromPatcher, resolveTailwindV4Source, resolveTailwindV4SourceFromPatchOptions, resolveTailwindV4SourceFromPatcher, resolveTailwindV4SourceOptionsFromPatcher, transformTailwindV3CssByTarget, transformTailwindV3CssToWeapp, transformTailwindV4CssByTarget, transformTailwindV4CssToWeapp };
|
package/dist/gulp.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_chunk = require("./chunk-
|
|
3
|
-
const require_v3_engine = require("./v3-engine-
|
|
4
|
-
const require_incremental_runtime_class_set = require("./incremental-runtime-class-set-
|
|
5
|
-
const require_precheck = require("./precheck-
|
|
6
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
7
|
-
const require_source_candidates = require("./source-candidates-
|
|
2
|
+
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
3
|
+
const require_v3_engine = require("./v3-engine-CHItlVq5.js");
|
|
4
|
+
const require_incremental_runtime_class_set = require("./incremental-runtime-class-set-DPQEzllt.js");
|
|
5
|
+
const require_precheck = require("./precheck-D7gJSmJz.js");
|
|
6
|
+
const require_tailwindcss = require("./tailwindcss-B-e2RiXr.js");
|
|
7
|
+
const require_source_candidates = require("./source-candidates-DNM8iwXW.js");
|
|
8
8
|
let node_fs = require("node:fs");
|
|
9
9
|
node_fs = require_chunk.__toESM(node_fs);
|
|
10
10
|
let node_path = require("node:path");
|
package/dist/gulp.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { c as upsertTailwindV4CssSource, s as hasConfiguredTailwindV4CssRoots } from "./tailwindcss-
|
|
5
|
-
import { t as createSourceCandidateCollector } from "./source-candidates-
|
|
1
|
+
import { b as ensureRuntimeClassSet, n as getCompilerContext, t as shouldSkipJsTransform, y as createTailwindRuntimeReadyPromise } from "./precheck-D7K12zeX.mjs";
|
|
2
|
+
import { B as createDebug, _ as resolveViteSourceScanEntries, l as getRuntimeClassSetSignature } from "./v3-engine-DcvCCHfs.mjs";
|
|
3
|
+
import { i as generateCssByGenerator, l as normalizeTailwindSourceForGenerator, o as processCachedTask, r as emitHmrTiming, s as hasTailwindRootDirectives, t as createBundleRuntimeClassSetManager } from "./incremental-runtime-class-set-CYkXVVCL.mjs";
|
|
4
|
+
import { c as upsertTailwindV4CssSource, s as hasConfiguredTailwindV4CssRoots } from "./tailwindcss-C7dJHZ0G.mjs";
|
|
5
|
+
import { t as createSourceCandidateCollector } from "./source-candidates-CX2ozpKM.mjs";
|
|
6
6
|
import fs from "node:fs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import process from "node:process";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { m as replaceWxml, r as resolveStyleOptionsFromContext } from "./precheck-D7K12zeX.mjs";
|
|
2
|
+
import { B as createDebug, D as loadTailwindV4DesignSystem, E as filterUnsupportedMiniProgramTailwindV4Candidates, R as resolveTailwindV4CssSourceBase, S as resolveTailwindV4SourceOptionsFromPatcher, h as resolveTailwindV4EntriesFromCss, l as getRuntimeClassSetSignature, n as resolveTailwindV3SourceFromPatcher, q as omitUndefined, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source$1 } from "./v3-engine-DcvCCHfs.mjs";
|
|
3
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-Qw-tZ0Z2.mjs";
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
5
5
|
import postcss from "postcss";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import process from "node:process";
|
|
8
|
-
import { extractRawCandidatesWithPositions, extractValidCandidates } from "tailwindcss-patch";
|
|
8
|
+
import { extractRawCandidatesWithPositions, extractSourceCandidates, extractValidCandidates } from "tailwindcss-patch";
|
|
9
9
|
import { finalizeMiniProgramCss, removeUnsupportedMiniProgramAtRules } from "@weapp-tailwindcss/postcss";
|
|
10
10
|
//#region src/bundlers/shared/generator-css/markers.ts
|
|
11
11
|
const TAILWIND_V4_BANNER_RE = /\/\*!\s*tailwindcss v4\./;
|
|
@@ -1308,6 +1308,16 @@ function mergeScopedRuntimeWithCurrentRuntime(scopedRuntime, runtime, options) {
|
|
|
1308
1308
|
function shouldIsolateMatchedCssSource(source, sourceEntries) {
|
|
1309
1309
|
return Boolean(source.__weappTailwindcssMeta?.matchedCssSourceFile && sourceEntries !== void 0);
|
|
1310
1310
|
}
|
|
1311
|
+
function shouldScanTailwindV4Sources(majorVersion, target, generatorRuntime, isolateCssSource) {
|
|
1312
|
+
if (majorVersion !== 4 || isolateCssSource) return false;
|
|
1313
|
+
return target === "web" || generatorRuntime.size === 0;
|
|
1314
|
+
}
|
|
1315
|
+
function shouldAppendWebBundleCssFallback(target, options) {
|
|
1316
|
+
return target === "web" && !options.hasMatchedCssSourceFile && !options.hasSourceDirectives;
|
|
1317
|
+
}
|
|
1318
|
+
function isEmptyCssSourceOrderParts(parts) {
|
|
1319
|
+
return parts.before.trim().length === 0 && parts.after.trim().length === 0;
|
|
1320
|
+
}
|
|
1311
1321
|
function resolveGeneratorStyleOptions(opts, cssHandlerOptions, generatorStyleOptions) {
|
|
1312
1322
|
const preflightStyleOptions = {
|
|
1313
1323
|
cssPreflight: opts.cssPreflight,
|
|
@@ -1447,9 +1457,11 @@ async function generateCssByGenerator(options) {
|
|
|
1447
1457
|
if (!SUPPORTED_GENERATOR_MAJOR_VERSIONS.has(majorVersion ?? 0) || !shouldGenerateCurrentCss || majorVersion === 3 && !hasSourceDirectives && !hasGeneratedCss && !hasGeneratedMarkers) return;
|
|
1448
1458
|
try {
|
|
1449
1459
|
await runtimeState.readyPromise;
|
|
1460
|
+
const currentCssCandidates = majorVersion === 4 ? await extractSourceCandidates(effectiveRawSource, "css") : [];
|
|
1461
|
+
const runtimeWithCurrentCss = currentCssCandidates.length > 0 ? new Set([...runtime, ...currentCssCandidates]) : runtime;
|
|
1450
1462
|
const sources = await resolveGeneratorSources(majorVersion, runtimeState, effectiveRawSource, file, cssHandlerOptions, generatorOptions, {
|
|
1451
1463
|
getSourceCandidatesForEntries,
|
|
1452
|
-
runtime
|
|
1464
|
+
runtime: runtimeWithCurrentCss
|
|
1453
1465
|
});
|
|
1454
1466
|
const generatorStyleOptions = resolveGeneratorStyleOptions(opts, cssHandlerOptions, generatorOptions.styleOptions);
|
|
1455
1467
|
const configuredContainerCompat = hasConfiguredContainerCompatSources(sources);
|
|
@@ -1458,15 +1470,15 @@ async function generateCssByGenerator(options) {
|
|
|
1458
1470
|
const sourceEntries = getSourceCandidatesForEntries && majorVersion === 4 ? await resolveGeneratorSourceEntries(source, runtimeState) : void 0;
|
|
1459
1471
|
const scopedRuntime = sourceEntries ? getSourceCandidatesForEntries?.(sourceEntries) : void 0;
|
|
1460
1472
|
const isolateCssSource = shouldIsolateMatchedCssSource(source, sourceEntries);
|
|
1461
|
-
const sourceRuntime = scopedRuntime && (scopedRuntime.size > 0 || isolateCssSource) ? mergeScopedRuntimeWithCurrentRuntime(scopedRuntime,
|
|
1473
|
+
const sourceRuntime = scopedRuntime && (scopedRuntime.size > 0 || isolateCssSource) ? mergeScopedRuntimeWithCurrentRuntime(scopedRuntime, runtimeWithCurrentCss, {
|
|
1462
1474
|
cssHandlerOptions,
|
|
1463
1475
|
isolateCssSource
|
|
1464
|
-
}) :
|
|
1476
|
+
}) : runtimeWithCurrentCss;
|
|
1465
1477
|
const generatorRuntime = majorVersion === 4 && generatorOptions.target === "weapp" ? filterUnsupportedMiniProgramTailwindV4Candidates(sourceRuntime) : sourceRuntime;
|
|
1466
1478
|
return generator.generate({
|
|
1467
1479
|
candidates: generatorRuntime,
|
|
1468
1480
|
incrementalCache: majorVersion === 3 || majorVersion === 4,
|
|
1469
|
-
scanSources: majorVersion
|
|
1481
|
+
scanSources: shouldScanTailwindV4Sources(majorVersion, generatorOptions.target, generatorRuntime, isolateCssSource),
|
|
1470
1482
|
styleOptions: generatorStyleOptions,
|
|
1471
1483
|
tailwindcssV3Compatibility: generatorOptions.tailwindcssV3Compatibility,
|
|
1472
1484
|
target: generatorOptions.target
|
|
@@ -1512,6 +1524,13 @@ async function generateCssByGenerator(options) {
|
|
|
1512
1524
|
const beforeUserCss = await transformGeneratorUserCss(orderedExtraCss.before, userCssOptions);
|
|
1513
1525
|
const afterUserCss = await transformGeneratorUserCss(orderedExtraCss.after, userCssOptions);
|
|
1514
1526
|
css = createCssSourceOrderAppend(createCssSourceOrderAppend(beforeUserCss, css), afterUserCss);
|
|
1527
|
+
if (isEmptyCssSourceOrderParts(orderedExtraCss) && shouldAppendWebBundleCssFallback(generated.target, {
|
|
1528
|
+
hasSourceDirectives,
|
|
1529
|
+
hasMatchedCssSourceFile
|
|
1530
|
+
})) {
|
|
1531
|
+
const userCss = await transformGeneratorUserCss(effectiveRawSource, userCssOptions);
|
|
1532
|
+
css = createCssSourceOrderAppend(css, userCss);
|
|
1533
|
+
}
|
|
1515
1534
|
if (generated.target === "weapp") {
|
|
1516
1535
|
css = await appendLegacyCompatCss(css, effectiveRawSource, generated.target, styleHandler, cssHandlerOptions, generatorStyleOptions);
|
|
1517
1536
|
css = await appendLegacyContainerCompatCss(css, effectiveRawSource, file, runtime, configuredContainerCompat, generated.target, styleHandler, cssHandlerOptions, generatorStyleOptions);
|
|
@@ -1526,12 +1545,27 @@ async function generateCssByGenerator(options) {
|
|
|
1526
1545
|
debug("tailwind direct css generation prefix mismatch, append transformed bundle css %s", file);
|
|
1527
1546
|
let css = stripTailwindBanner(generated.css);
|
|
1528
1547
|
if (generated.target === "weapp") css = inheritLegacyUnitConvertedDeclarations(css, effectiveRawSource);
|
|
1529
|
-
if (hasMatchedCssSourceFile || generated.target === "web")
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1548
|
+
if (hasMatchedCssSourceFile || generated.target === "web") {
|
|
1549
|
+
if (shouldAppendWebBundleCssFallback(generated.target, {
|
|
1550
|
+
hasSourceDirectives,
|
|
1551
|
+
hasMatchedCssSourceFile
|
|
1552
|
+
})) {
|
|
1553
|
+
const userCss = await transformGeneratorUserCss(effectiveRawSource, {
|
|
1554
|
+
generatorTarget: generated.target,
|
|
1555
|
+
generatorStyleOptions,
|
|
1556
|
+
cssUserHandlerOptions,
|
|
1557
|
+
styleHandler,
|
|
1558
|
+
importFallback: generatorOptions.importFallback
|
|
1559
|
+
});
|
|
1560
|
+
css = createCssSourceOrderAppend(css, userCss);
|
|
1561
|
+
}
|
|
1562
|
+
return {
|
|
1563
|
+
css: finalizeMiniProgramGeneratorCss(css, generated.target, majorVersion, opts.cssPreflight),
|
|
1564
|
+
target: generated.target,
|
|
1565
|
+
source: "generator",
|
|
1566
|
+
dependencies: generated.dependencies
|
|
1567
|
+
};
|
|
1568
|
+
}
|
|
1535
1569
|
css = await appendLegacyCompatCss(css, effectiveRawSource, generated.target, styleHandler, cssHandlerOptions, generatorStyleOptions);
|
|
1536
1570
|
css = await appendLegacyContainerCompatCss(css, effectiveRawSource, file, runtime, configuredContainerCompat, generated.target, styleHandler, cssHandlerOptions, generatorStyleOptions);
|
|
1537
1571
|
return {
|
package/dist/{incremental-runtime-class-set-mY0v1k-Y.js → incremental-runtime-class-set-DPQEzllt.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_chunk = require("./chunk-
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
-
const require_generator = require("./generator-
|
|
4
|
-
const require_precheck = require("./precheck-
|
|
1
|
+
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
+
const require_v3_engine = require("./v3-engine-CHItlVq5.js");
|
|
3
|
+
const require_generator = require("./generator-CrU-Ghc1.js");
|
|
4
|
+
const require_precheck = require("./precheck-D7gJSmJz.js");
|
|
5
5
|
let node_fs = require("node:fs");
|
|
6
6
|
let postcss = require("postcss");
|
|
7
7
|
postcss = require_chunk.__toESM(postcss);
|
|
@@ -1312,6 +1312,16 @@ function mergeScopedRuntimeWithCurrentRuntime(scopedRuntime, runtime, options) {
|
|
|
1312
1312
|
function shouldIsolateMatchedCssSource(source, sourceEntries) {
|
|
1313
1313
|
return Boolean(source.__weappTailwindcssMeta?.matchedCssSourceFile && sourceEntries !== void 0);
|
|
1314
1314
|
}
|
|
1315
|
+
function shouldScanTailwindV4Sources(majorVersion, target, generatorRuntime, isolateCssSource) {
|
|
1316
|
+
if (majorVersion !== 4 || isolateCssSource) return false;
|
|
1317
|
+
return target === "web" || generatorRuntime.size === 0;
|
|
1318
|
+
}
|
|
1319
|
+
function shouldAppendWebBundleCssFallback(target, options) {
|
|
1320
|
+
return target === "web" && !options.hasMatchedCssSourceFile && !options.hasSourceDirectives;
|
|
1321
|
+
}
|
|
1322
|
+
function isEmptyCssSourceOrderParts(parts) {
|
|
1323
|
+
return parts.before.trim().length === 0 && parts.after.trim().length === 0;
|
|
1324
|
+
}
|
|
1315
1325
|
function resolveGeneratorStyleOptions(opts, cssHandlerOptions, generatorStyleOptions) {
|
|
1316
1326
|
const preflightStyleOptions = {
|
|
1317
1327
|
cssPreflight: opts.cssPreflight,
|
|
@@ -1451,9 +1461,11 @@ async function generateCssByGenerator(options) {
|
|
|
1451
1461
|
if (!SUPPORTED_GENERATOR_MAJOR_VERSIONS.has(majorVersion ?? 0) || !shouldGenerateCurrentCss || majorVersion === 3 && !hasSourceDirectives && !hasGeneratedCss && !hasGeneratedMarkers) return;
|
|
1452
1462
|
try {
|
|
1453
1463
|
await runtimeState.readyPromise;
|
|
1464
|
+
const currentCssCandidates = majorVersion === 4 ? await (0, tailwindcss_patch.extractSourceCandidates)(effectiveRawSource, "css") : [];
|
|
1465
|
+
const runtimeWithCurrentCss = currentCssCandidates.length > 0 ? new Set([...runtime, ...currentCssCandidates]) : runtime;
|
|
1454
1466
|
const sources = await resolveGeneratorSources(majorVersion, runtimeState, effectiveRawSource, file, cssHandlerOptions, generatorOptions, {
|
|
1455
1467
|
getSourceCandidatesForEntries,
|
|
1456
|
-
runtime
|
|
1468
|
+
runtime: runtimeWithCurrentCss
|
|
1457
1469
|
});
|
|
1458
1470
|
const generatorStyleOptions = resolveGeneratorStyleOptions(opts, cssHandlerOptions, generatorOptions.styleOptions);
|
|
1459
1471
|
const configuredContainerCompat = hasConfiguredContainerCompatSources(sources);
|
|
@@ -1462,15 +1474,15 @@ async function generateCssByGenerator(options) {
|
|
|
1462
1474
|
const sourceEntries = getSourceCandidatesForEntries && majorVersion === 4 ? await resolveGeneratorSourceEntries(source, runtimeState) : void 0;
|
|
1463
1475
|
const scopedRuntime = sourceEntries ? getSourceCandidatesForEntries?.(sourceEntries) : void 0;
|
|
1464
1476
|
const isolateCssSource = shouldIsolateMatchedCssSource(source, sourceEntries);
|
|
1465
|
-
const sourceRuntime = scopedRuntime && (scopedRuntime.size > 0 || isolateCssSource) ? mergeScopedRuntimeWithCurrentRuntime(scopedRuntime,
|
|
1477
|
+
const sourceRuntime = scopedRuntime && (scopedRuntime.size > 0 || isolateCssSource) ? mergeScopedRuntimeWithCurrentRuntime(scopedRuntime, runtimeWithCurrentCss, {
|
|
1466
1478
|
cssHandlerOptions,
|
|
1467
1479
|
isolateCssSource
|
|
1468
|
-
}) :
|
|
1480
|
+
}) : runtimeWithCurrentCss;
|
|
1469
1481
|
const generatorRuntime = majorVersion === 4 && generatorOptions.target === "weapp" ? require_v3_engine.filterUnsupportedMiniProgramTailwindV4Candidates(sourceRuntime) : sourceRuntime;
|
|
1470
1482
|
return generator.generate({
|
|
1471
1483
|
candidates: generatorRuntime,
|
|
1472
1484
|
incrementalCache: majorVersion === 3 || majorVersion === 4,
|
|
1473
|
-
scanSources: majorVersion
|
|
1485
|
+
scanSources: shouldScanTailwindV4Sources(majorVersion, generatorOptions.target, generatorRuntime, isolateCssSource),
|
|
1474
1486
|
styleOptions: generatorStyleOptions,
|
|
1475
1487
|
tailwindcssV3Compatibility: generatorOptions.tailwindcssV3Compatibility,
|
|
1476
1488
|
target: generatorOptions.target
|
|
@@ -1516,6 +1528,13 @@ async function generateCssByGenerator(options) {
|
|
|
1516
1528
|
const beforeUserCss = await transformGeneratorUserCss(orderedExtraCss.before, userCssOptions);
|
|
1517
1529
|
const afterUserCss = await transformGeneratorUserCss(orderedExtraCss.after, userCssOptions);
|
|
1518
1530
|
css = createCssSourceOrderAppend(createCssSourceOrderAppend(beforeUserCss, css), afterUserCss);
|
|
1531
|
+
if (isEmptyCssSourceOrderParts(orderedExtraCss) && shouldAppendWebBundleCssFallback(generated.target, {
|
|
1532
|
+
hasSourceDirectives,
|
|
1533
|
+
hasMatchedCssSourceFile
|
|
1534
|
+
})) {
|
|
1535
|
+
const userCss = await transformGeneratorUserCss(effectiveRawSource, userCssOptions);
|
|
1536
|
+
css = createCssSourceOrderAppend(css, userCss);
|
|
1537
|
+
}
|
|
1519
1538
|
if (generated.target === "weapp") {
|
|
1520
1539
|
css = await appendLegacyCompatCss(css, effectiveRawSource, generated.target, styleHandler, cssHandlerOptions, generatorStyleOptions);
|
|
1521
1540
|
css = await appendLegacyContainerCompatCss(css, effectiveRawSource, file, runtime, configuredContainerCompat, generated.target, styleHandler, cssHandlerOptions, generatorStyleOptions);
|
|
@@ -1530,12 +1549,27 @@ async function generateCssByGenerator(options) {
|
|
|
1530
1549
|
debug("tailwind direct css generation prefix mismatch, append transformed bundle css %s", file);
|
|
1531
1550
|
let css = stripTailwindBanner(generated.css);
|
|
1532
1551
|
if (generated.target === "weapp") css = inheritLegacyUnitConvertedDeclarations(css, effectiveRawSource);
|
|
1533
|
-
if (hasMatchedCssSourceFile || generated.target === "web")
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1552
|
+
if (hasMatchedCssSourceFile || generated.target === "web") {
|
|
1553
|
+
if (shouldAppendWebBundleCssFallback(generated.target, {
|
|
1554
|
+
hasSourceDirectives,
|
|
1555
|
+
hasMatchedCssSourceFile
|
|
1556
|
+
})) {
|
|
1557
|
+
const userCss = await transformGeneratorUserCss(effectiveRawSource, {
|
|
1558
|
+
generatorTarget: generated.target,
|
|
1559
|
+
generatorStyleOptions,
|
|
1560
|
+
cssUserHandlerOptions,
|
|
1561
|
+
styleHandler,
|
|
1562
|
+
importFallback: generatorOptions.importFallback
|
|
1563
|
+
});
|
|
1564
|
+
css = createCssSourceOrderAppend(css, userCss);
|
|
1565
|
+
}
|
|
1566
|
+
return {
|
|
1567
|
+
css: finalizeMiniProgramGeneratorCss(css, generated.target, majorVersion, opts.cssPreflight),
|
|
1568
|
+
target: generated.target,
|
|
1569
|
+
source: "generator",
|
|
1570
|
+
dependencies: generated.dependencies
|
|
1571
|
+
};
|
|
1572
|
+
}
|
|
1539
1573
|
css = await appendLegacyCompatCss(css, effectiveRawSource, generated.target, styleHandler, cssHandlerOptions, generatorStyleOptions);
|
|
1540
1574
|
css = await appendLegacyContainerCompatCss(css, effectiveRawSource, file, runtime, configuredContainerCompat, generated.target, styleHandler, cssHandlerOptions, generatorStyleOptions);
|
|
1541
1575
|
return {
|