weapp-tailwindcss 5.0.4 → 5.0.5
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-BZ4n4Icc.js → auto-Cvy0zWpS.js} +1 -1
- package/dist/{bundle-state-D3RZHkXz.js → bundle-state-Cso_ceUo.js} +8 -2
- package/dist/{bundle-state-C-p9eFz1.mjs → bundle-state-DEyxCR4f.mjs} +2 -2
- package/dist/bundlers/shared/generator-css/directives.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle.d.ts +3 -1
- package/dist/bundlers/vite/rewrite-css-imports.d.ts +8 -0
- package/dist/bundlers/vite/serve-css-generation.d.ts +5 -0
- package/dist/bundlers/vite/uni-app-x-css-options.d.ts +2 -0
- package/dist/{chunk-D6vf50IK.js → chunk-emK7D4bc.js} +7 -0
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/css-macro.js +3 -3
- package/dist/{defaults-C5w9OOrj.js → defaults-BPUuNYcD.js} +1 -1
- package/dist/defaults.js +1 -1
- package/dist/{generator-DaPOkJ7W.js → generator-AD-eX8Tr.js} +2 -2
- package/dist/{generator-DRHWC1t-.mjs → generator-DVWLNO0n.mjs} +1 -1
- package/dist/generator.js +2 -2
- package/dist/generator.mjs +2 -2
- package/dist/gulp.js +6 -6
- package/dist/gulp.mjs +5 -5
- package/dist/{incremental-runtime-class-set-BYV0yQdp.js → incremental-runtime-class-set-vOetpdWs.js} +195 -43
- package/dist/{incremental-runtime-class-set-Dt-FUQB5.mjs → incremental-runtime-class-set-xf49kky6.mjs} +194 -42
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/{postcss-Du8hY-MN.js → postcss-Cbi6RFpf.js} +57 -10
- package/dist/{postcss-CJrmfXvi.mjs → postcss-hSUxK7oR.mjs} +55 -8
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss.js +1 -1
- package/dist/postcss.mjs +1 -1
- package/dist/{precheck-lfenbOTF.mjs → precheck-Bsn_LMmo.mjs} +14 -3
- package/dist/{precheck-DgpVCvYk.js → precheck-b8Y8qZg0.js} +17 -6
- package/dist/presets.js +9 -5
- package/dist/presets.mjs +7 -3
- package/dist/reset.js +1 -1
- package/dist/{source-candidates-D7b-Jzsx.mjs → source-candidates-BsWYoIPN.mjs} +1 -1
- package/dist/{source-candidates-B4NvId_j.js → source-candidates-o2ZrKWzu.js} +2 -2
- package/dist/{tailwindcss-D5RogwtV.mjs → tailwindcss-AWaPVF2B.mjs} +1 -1
- package/dist/{tailwindcss-26ZFr5kv.js → tailwindcss-CpQ6X4l6.js} +3 -3
- package/dist/transform-BkGtbxb1.js +14868 -0
- package/dist/transform-DumSZmTh.mjs +14871 -0
- package/dist/uni-app-x/vite.d.ts +3 -0
- package/dist/{utils-nta4tfFs.js → utils-Dolmt8EO.js} +1 -1
- package/dist/{v3-engine-CBahpuIg.js → v3-engine-CM0TRa8V.js} +29 -5
- package/dist/{v3-engine-BCUGX3gX.mjs → v3-engine-Cczrkzqt.mjs} +22 -4
- package/dist/{vite-tjYalmVX.js → vite-CTuHPC91.js} +733 -79
- package/dist/{vite-DS4H5d0f.mjs → vite-DLXDMHON.mjs} +745 -91
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +201 -42
- package/dist/{webpack-0BwLOE_f.js → webpack-BBHJYKqB.js} +8 -8
- package/dist/{webpack-CA-40WU9.mjs → webpack-DJFw08SK.mjs} +6 -6
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +2 -3
- package/dist/transform-Crn84vTL.js +0 -257
- package/dist/transform-FAxHXVZp.mjs +0 -255
package/dist/uni-app-x/vite.d.ts
CHANGED
|
@@ -12,6 +12,9 @@ interface CreateUniAppXPluginsOptions {
|
|
|
12
12
|
mainCssChunkMatcher: NonNullable<InternalUserDefinedOptions['mainCssChunkMatcher']>;
|
|
13
13
|
runtimeState: UniAppXRuntimeState;
|
|
14
14
|
styleHandler: InternalUserDefinedOptions['styleHandler'];
|
|
15
|
+
generateCss?: ((id: string, code: string, hookContext?: {
|
|
16
|
+
addWatchFile?: (id: string) => void;
|
|
17
|
+
}) => Promise<string | undefined> | string | undefined) | undefined;
|
|
15
18
|
jsHandler: JsHandler;
|
|
16
19
|
ensureRuntimeClassSet: (force?: boolean) => Promise<Set<string>>;
|
|
17
20
|
getResolvedConfig: () => ResolvedConfig | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_chunk = require("./chunk-
|
|
2
|
-
const require_auto = require("./auto-
|
|
1
|
+
const require_chunk = require("./chunk-emK7D4bc.js");
|
|
2
|
+
const require_auto = require("./auto-Cvy0zWpS.js");
|
|
3
3
|
let node_fs = require("node:fs");
|
|
4
4
|
node_fs = require_chunk.__toESM(node_fs);
|
|
5
5
|
let node_module = require("node:module");
|
|
@@ -2083,6 +2083,19 @@ const TAILWIND_V3_SUBPATH_IMPORT_LAYERS = new Map([
|
|
|
2083
2083
|
function parseImportRequest(params) {
|
|
2084
2084
|
return /^(?:url\(\s*)?(["']?)([^"')\s]+)\1\s*\)?/.exec(params.trim())?.[2];
|
|
2085
2085
|
}
|
|
2086
|
+
function hasLocalCssImport(rawSource) {
|
|
2087
|
+
let found = false;
|
|
2088
|
+
try {
|
|
2089
|
+
postcss.default.parse(rawSource).walkAtRules("import", (rule) => {
|
|
2090
|
+
const request = parseImportRequest(rule.params);
|
|
2091
|
+
if (request?.startsWith(".") === true || request?.startsWith("/") === true) {
|
|
2092
|
+
found = true;
|
|
2093
|
+
return false;
|
|
2094
|
+
}
|
|
2095
|
+
});
|
|
2096
|
+
} catch {}
|
|
2097
|
+
return found;
|
|
2098
|
+
}
|
|
2086
2099
|
function parseConfigRequest(params) {
|
|
2087
2100
|
return /^(["'])(.+)\1\s*;?$/.exec(params.trim())?.[2];
|
|
2088
2101
|
}
|
|
@@ -2495,7 +2508,10 @@ function resolveConfigDir(config, projectRoot) {
|
|
|
2495
2508
|
return node_path.default.dirname(configPath);
|
|
2496
2509
|
}
|
|
2497
2510
|
function isBarePackageSpecifier(specifier) {
|
|
2498
|
-
return !specifier.startsWith(".") && !specifier.startsWith("/") && !specifier.includes("\\") && !/^[a-z][a-z\d+.-]*:/i.test(specifier);
|
|
2511
|
+
return !specifier.startsWith(".") && !specifier.startsWith("/") && !specifier.startsWith("#") && !specifier.includes("\\") && !/^[a-z][a-z\d+.-]*:/i.test(specifier);
|
|
2512
|
+
}
|
|
2513
|
+
function isPackageJsonImportSpecifier(specifier) {
|
|
2514
|
+
return typeof specifier === "string" && specifier.startsWith("#");
|
|
2499
2515
|
}
|
|
2500
2516
|
function parseCssImportSpecifier$1(params) {
|
|
2501
2517
|
const value = params.trim();
|
|
@@ -2537,7 +2553,8 @@ function normalizeTailwindV4CssPackageImports(css, packageName) {
|
|
|
2537
2553
|
}
|
|
2538
2554
|
const importSpecifiers = createTailwindV4CssImportSpecifierSet(packageName);
|
|
2539
2555
|
let changed = false;
|
|
2540
|
-
root.walkAtRules(
|
|
2556
|
+
root.walkAtRules((rule) => {
|
|
2557
|
+
if (rule.name !== "import" && rule.name !== "reference") return;
|
|
2541
2558
|
const parsed = parseCssImportSpecifier$1(rule.params);
|
|
2542
2559
|
if (!parsed || !importSpecifiers.has(parsed.specifier)) return;
|
|
2543
2560
|
const cssEntryPoint = resolvePackageCssEntryPoint(`${parsed.specifier}/index.css`);
|
|
@@ -2574,7 +2591,8 @@ function normalizeTailwindV4CssEntrySources(cssEntries, packageName) {
|
|
|
2574
2591
|
}
|
|
2575
2592
|
const base = node_path.default.dirname(file);
|
|
2576
2593
|
const rawCss = (0, node_fs.readFileSync)(file, "utf8");
|
|
2577
|
-
const
|
|
2594
|
+
const entrySource = resolveCssEntrySource(rawCss, base, { removeConfig: false });
|
|
2595
|
+
const css = normalizeTailwindV4CssPackageImports(normalizeConfigDirective(rawCss, entrySource?.config && (0, node_fs.existsSync)(entrySource.config) ? entrySource.config : entrySource?.configRequest && !node_path.default.isAbsolute(entrySource.configRequest) && !isPackageJsonImportSpecifier(entrySource.configRequest) ? node_path.default.resolve(base, entrySource.configRequest) : entrySource?.config), packageName);
|
|
2578
2596
|
cssSources.push({
|
|
2579
2597
|
file,
|
|
2580
2598
|
base,
|
|
@@ -4162,6 +4180,12 @@ Object.defineProperty(exports, "getRuntimeClassSetSignatureWithSources", {
|
|
|
4162
4180
|
return getRuntimeClassSetSignatureWithSources;
|
|
4163
4181
|
}
|
|
4164
4182
|
});
|
|
4183
|
+
Object.defineProperty(exports, "hasLocalCssImport", {
|
|
4184
|
+
enumerable: true,
|
|
4185
|
+
get: function() {
|
|
4186
|
+
return hasLocalCssImport;
|
|
4187
|
+
}
|
|
4188
|
+
});
|
|
4165
4189
|
Object.defineProperty(exports, "hasTailwindApplyDirective", {
|
|
4166
4190
|
enumerable: true,
|
|
4167
4191
|
get: function() {
|
|
@@ -2075,6 +2075,19 @@ const TAILWIND_V3_SUBPATH_IMPORT_LAYERS = new Map([
|
|
|
2075
2075
|
function parseImportRequest(params) {
|
|
2076
2076
|
return /^(?:url\(\s*)?(["']?)([^"')\s]+)\1\s*\)?/.exec(params.trim())?.[2];
|
|
2077
2077
|
}
|
|
2078
|
+
function hasLocalCssImport(rawSource) {
|
|
2079
|
+
let found = false;
|
|
2080
|
+
try {
|
|
2081
|
+
postcss.parse(rawSource).walkAtRules("import", (rule) => {
|
|
2082
|
+
const request = parseImportRequest(rule.params);
|
|
2083
|
+
if (request?.startsWith(".") === true || request?.startsWith("/") === true) {
|
|
2084
|
+
found = true;
|
|
2085
|
+
return false;
|
|
2086
|
+
}
|
|
2087
|
+
});
|
|
2088
|
+
} catch {}
|
|
2089
|
+
return found;
|
|
2090
|
+
}
|
|
2078
2091
|
function parseConfigRequest(params) {
|
|
2079
2092
|
return /^(["'])(.+)\1\s*;?$/.exec(params.trim())?.[2];
|
|
2080
2093
|
}
|
|
@@ -2487,7 +2500,10 @@ function resolveConfigDir(config, projectRoot) {
|
|
|
2487
2500
|
return path.dirname(configPath);
|
|
2488
2501
|
}
|
|
2489
2502
|
function isBarePackageSpecifier(specifier) {
|
|
2490
|
-
return !specifier.startsWith(".") && !specifier.startsWith("/") && !specifier.includes("\\") && !/^[a-z][a-z\d+.-]*:/i.test(specifier);
|
|
2503
|
+
return !specifier.startsWith(".") && !specifier.startsWith("/") && !specifier.startsWith("#") && !specifier.includes("\\") && !/^[a-z][a-z\d+.-]*:/i.test(specifier);
|
|
2504
|
+
}
|
|
2505
|
+
function isPackageJsonImportSpecifier(specifier) {
|
|
2506
|
+
return typeof specifier === "string" && specifier.startsWith("#");
|
|
2491
2507
|
}
|
|
2492
2508
|
function parseCssImportSpecifier$1(params) {
|
|
2493
2509
|
const value = params.trim();
|
|
@@ -2529,7 +2545,8 @@ function normalizeTailwindV4CssPackageImports(css, packageName) {
|
|
|
2529
2545
|
}
|
|
2530
2546
|
const importSpecifiers = createTailwindV4CssImportSpecifierSet(packageName);
|
|
2531
2547
|
let changed = false;
|
|
2532
|
-
root.walkAtRules(
|
|
2548
|
+
root.walkAtRules((rule) => {
|
|
2549
|
+
if (rule.name !== "import" && rule.name !== "reference") return;
|
|
2533
2550
|
const parsed = parseCssImportSpecifier$1(rule.params);
|
|
2534
2551
|
if (!parsed || !importSpecifiers.has(parsed.specifier)) return;
|
|
2535
2552
|
const cssEntryPoint = resolvePackageCssEntryPoint(`${parsed.specifier}/index.css`);
|
|
@@ -2566,7 +2583,8 @@ function normalizeTailwindV4CssEntrySources(cssEntries, packageName) {
|
|
|
2566
2583
|
}
|
|
2567
2584
|
const base = path.dirname(file);
|
|
2568
2585
|
const rawCss = readFileSync(file, "utf8");
|
|
2569
|
-
const
|
|
2586
|
+
const entrySource = resolveCssEntrySource(rawCss, base, { removeConfig: false });
|
|
2587
|
+
const css = normalizeTailwindV4CssPackageImports(normalizeConfigDirective(rawCss, entrySource?.config && existsSync(entrySource.config) ? entrySource.config : entrySource?.configRequest && !path.isAbsolute(entrySource.configRequest) && !isPackageJsonImportSpecifier(entrySource.configRequest) ? path.resolve(base, entrySource.configRequest) : entrySource?.config), packageName);
|
|
2570
2588
|
cssSources.push({
|
|
2571
2589
|
file,
|
|
2572
2590
|
base,
|
|
@@ -4022,4 +4040,4 @@ function resolveTailwindV3SourceFromPatcher(patcher) {
|
|
|
4022
4040
|
return resolveTailwindV3Source(resolveTailwindV3SourceOptionsFromPatcher(patcher));
|
|
4023
4041
|
}
|
|
4024
4042
|
//#endregion
|
|
4025
|
-
export {
|
|
4043
|
+
export { collectCssInlineSourceCandidates as $, normalizeTailwindV3CssEntrySource as A, splitTailwindV4GeneratedCssBySourceOrder as B, hasLocalCssImport as C, normalizeTailwindConfigDirectives as D, hasTailwindSourceDirectives as E, createCssAppend as F, prependConfigDirective as G, stripTailwindBanner as H, hasTailwindGeneratedCss as I, transformTailwindV4CssToWeapp as J, createTailwindV4Engine$1 as K, hasTailwindGeneratedCssMarkers as L, removeTailwindSourceDirectives as M, resolveCssEntrySource as N, normalizeTailwindSourceDirectives as O, VITE_MARKER_RE as P, FULL_SOURCE_SCAN_EXTENSION_RE as Q, splitGeneratorPlaceholderCssBySourceOrder as R, resolveTailwindV4SourceOptionsFromPatcher as S, hasTailwindRootDirectives as T, stripTailwindBanners as U, stripGeneratorPlaceholderMarkers as V, normalizeConfigDirective as W, loadTailwindV4DesignSystem as X, filterUnsupportedMiniProgramTailwindV4Candidates as Y, DEFAULT_SOURCE_SCAN_EXTENSIONS as Z, resolveViteSourceScanEntries as _, findNearestPackageRoot as _t, transformTailwindV3CssByTarget as a, resolveCssSourceEntries as at, resolveTailwindV4SourceFromPatchOptions as b, getRuntimeClassSetCacheEntry as c, toPosixPath as ct, invalidateRuntimeClassSet as d, readInstalledPackageMajorVersion as dt, createSourceScanPattern as et, runtimeSignaturePatchersSymbol as f, findTailwindConfig as ft, resolveTailwindV4EntriesFromCssCached as g, omitUndefined as gt, resolveTailwindV4EntriesFromCss as h, resolveBooleanObjectOption as ht, createTailwindV3Engine as i, parseConfigParam$1 as it, parseImportRequest as j, normalizeTailwindSourceForGenerator as k, getRuntimeClassSetSignature as l, createDebug as lt, discoverTailwindV4CssEntries as m, normalizeStringListOption as mt, resolveTailwindV3SourceFromPatcher as n, isFileMatchedByTailwindSourceEntries as nt, transformTailwindV3CssToWeapp as o, resolveSourceScanPath as ot, createViteSourceScanMatcher as p, resolveTailwindcssOptions as pt, transformTailwindV4CssByTarget as q, resolveTailwindV3SourceOptionsFromPatcher as r, normalizeLegacyContentEntries as rt, ensureTailwindcssRuntimePatch as s, resolveTailwindV4CssSourceBase as st, resolveTailwindV3Source as t, expandTailwindSourceEntries as tt, getRuntimeClassSetSignatureWithSources as u, createTailwindcssPatcher as ut, resolveViteTailwindV4CssDependencies as v, findWorkspacePackageDir as vt, hasTailwindApplyDirective as w, resolveTailwindV4SourceFromPatcher as x, resolveTailwindV4Source$1 as y, findWorkspaceRoot as yt, splitTailwindGeneratedCssByBanner as z };
|