weapp-tailwindcss 5.1.9 → 5.1.11
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/bundlers/shared/generator-css/generation-helpers.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/output-import-shell.d.ts +4 -0
- package/dist/bundlers/shared/generator-css/source-resolver/metadata.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/types.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/css-assets.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/scoped-generator.d.ts +1 -0
- package/dist/bundlers/vite/hot-css-modules.d.ts +1 -1
- package/dist/bundlers/vite/source-candidates.d.ts +7 -2
- package/dist/bundlers/vite/web-css-compat.d.ts +3 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/css-source-resolvers.d.ts +9 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers.d.ts +3 -0
- package/dist/cli.js +3 -2
- package/dist/cli.mjs +2 -1
- package/dist/{context-CfXr3hWz.mjs → context-DzkSFEVL.mjs} +4 -4
- package/dist/{context-CRhUs_5e.js → context-y2BGCok4.js} +10 -10
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/generator/options.d.ts +8 -1
- package/dist/{v4-engine-BZP2462H.js → generator-Bz94KTkH.js} +229 -17
- package/dist/{v4-engine-CjjWONB0.mjs → generator-ROzBodj6.mjs} +185 -9
- package/dist/generator.js +7 -8
- package/dist/generator.mjs +1 -2
- package/dist/{gulp-CRjkPsbX.mjs → gulp-BKqMb_Ds.mjs} +4 -4
- package/dist/{gulp-JUfnhOOo.js → gulp-DfOLvYLs.js} +10 -10
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-DcIEXnf8.js → hmr-timing-DOTdH18A.js} +556 -170
- package/dist/{hmr-timing-BecOXMd8.mjs → hmr-timing-DwtYJdwb.mjs} +430 -56
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/postcss.js +2 -3
- package/dist/postcss.mjs +1 -2
- package/dist/presets.js +7 -6
- package/dist/presets.mjs +5 -4
- package/dist/rspack.js +1 -1
- package/dist/rspack.mjs +1 -1
- package/dist/{source-candidate-scan-signature-10tvdJVC.js → source-candidate-scan-signature-BrWuBTjY.js} +34 -6
- package/dist/{source-candidate-scan-signature-DAg8QSgh.mjs → source-candidate-scan-signature-CQ04hiox.mjs} +29 -7
- package/dist/{tailwindcss-BZjZZi60.js → tailwindcss-Dn5DVlkI.js} +55 -47
- package/dist/{tailwindcss-PA2jHHpx.mjs → tailwindcss-hzy_WaC9.mjs} +14 -6
- package/dist/{transform-wNEbcZeQ.mjs → transform-BgnNYkIG.mjs} +1 -1
- package/dist/{transform-B0BxX3XB.js → transform-DZQETx51.js} +1 -1
- package/dist/{vite-CHk7V9EA.js → vite-DODC15Fr.js} +865 -254
- package/dist/{vite-ClpyoD9e.mjs → vite-oI2ReOic.mjs} +818 -207
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +613 -63
- package/dist/{webpack-2s-TFhgm.mjs → webpack-CCapGlNg.mjs} +235 -38
- package/dist/{webpack-BhM4Hqla.js → webpack-XxBCIrBp.js} +276 -79
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +5 -5
- package/dist/generator-DaaFxR5V.js +0 -174
- package/dist/generator-DugIHBgl.mjs +0 -127
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_framework = require("./framework.js");
|
|
3
|
-
const require_generator = require("./generator-
|
|
4
|
-
const require_gulp = require("./gulp-
|
|
3
|
+
const require_generator = require("./generator-Bz94KTkH.js");
|
|
4
|
+
const require_gulp = require("./gulp-DfOLvYLs.js");
|
|
5
5
|
const require_postcss = require("./postcss.js");
|
|
6
|
-
const require_vite = require("./vite-
|
|
7
|
-
const require_webpack = require("./webpack-
|
|
6
|
+
const require_vite = require("./vite-DODC15Fr.js");
|
|
7
|
+
const require_webpack = require("./webpack-XxBCIrBp.js");
|
|
8
8
|
require("./webpack.js");
|
|
9
9
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
10
10
|
exports.WeappTailwindcss = require_vite.WeappTailwindcss;
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { detectAppType, detectAppTypeFromEnv, detectAppTypeFromPackageJson, isMpxPackage, isRunningInHBuilderX, isTaroPackage, isUniAppPackage, isUniAppVitePackage, isUniAppXManifest, isUniAppXPackage, isWeappVitePackage, resolveImplicitAppTypeFromViteRoot, resolveMpxPlatform, resolvePlatform, resolveTaroPlatform, resolveUniAppXPlatform, resolveUniPlatform, resolveUniPlatformsFromEnv, resolveUniUtsPlatform } from "./framework.mjs";
|
|
2
|
-
import { t as createWeappTailwindcssGenerator } from "./generator-
|
|
3
|
-
import { t as createPlugins } from "./gulp-
|
|
2
|
+
import { t as createWeappTailwindcssGenerator } from "./generator-ROzBodj6.mjs";
|
|
3
|
+
import { t as createPlugins } from "./gulp-BKqMb_Ds.mjs";
|
|
4
4
|
import weappTailwindcssPostcssPlugin from "./postcss.mjs";
|
|
5
|
-
import { t as WeappTailwindcss } from "./vite-
|
|
6
|
-
import { n as weappTailwindcssPackageDir } from "./webpack-
|
|
5
|
+
import { t as WeappTailwindcss } from "./vite-oI2ReOic.mjs";
|
|
6
|
+
import { n as weappTailwindcssPackageDir } from "./webpack-CCapGlNg.mjs";
|
|
7
7
|
import "./webpack.mjs";
|
|
8
8
|
import { unitConversionComposeRules, unitConversionPresets } from "@weapp-tailwindcss/postcss";
|
|
9
9
|
export { WeappTailwindcss, createPlugins, createWeappTailwindcssGenerator, detectAppType, detectAppTypeFromEnv, detectAppTypeFromPackageJson, isMpxPackage, isRunningInHBuilderX, isTaroPackage, isUniAppPackage, isUniAppVitePackage, isUniAppXManifest, isUniAppXPackage, isWeappVitePackage, resolveImplicitAppTypeFromViteRoot, resolveMpxPlatform, resolvePlatform, resolveTaroPlatform, resolveUniAppXPlatform, resolveUniPlatform, resolveUniPlatformsFromEnv, resolveUniUtsPlatform, unitConversionComposeRules, unitConversionPresets, weappTailwindcssPackageDir, weappTailwindcssPostcssPlugin };
|
package/dist/postcss.js
CHANGED
|
@@ -2,14 +2,13 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const
|
|
6
|
-
const require_generator = require("./generator-DaaFxR5V.js");
|
|
5
|
+
const require_generator = require("./generator-Bz94KTkH.js");
|
|
7
6
|
const weappTailwindcssPostcssPlugin = (0, require("@weapp-tailwindcss/postcss").createWeappTailwindcssPostcssPlugin)({
|
|
8
7
|
createGenerator: (source) => {
|
|
9
8
|
return require_generator.createWeappTailwindcssGenerator(source);
|
|
10
9
|
},
|
|
11
10
|
normalizeGeneratorOptions: (options) => require_generator.normalizeWeappTailwindcssGeneratorOptions(options),
|
|
12
|
-
resolveTailwindV4Source: (options) =>
|
|
11
|
+
resolveTailwindV4Source: (options) => require_generator.resolveTailwindV4Source(options)
|
|
13
12
|
});
|
|
14
13
|
//#endregion
|
|
15
14
|
exports.default = weappTailwindcssPostcssPlugin;
|
package/dist/postcss.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-DugIHBgl.mjs";
|
|
1
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions, l as resolveTailwindV4Source, t as createWeappTailwindcssGenerator } from "./generator-ROzBodj6.mjs";
|
|
3
2
|
import { createWeappTailwindcssPostcssPlugin } from "@weapp-tailwindcss/postcss";
|
|
4
3
|
const weappTailwindcssPostcssPlugin = createWeappTailwindcssPostcssPlugin({
|
|
5
4
|
createGenerator: (source) => {
|
package/dist/presets.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.js");
|
|
3
3
|
const require_framework = require("./framework.js");
|
|
4
|
-
const
|
|
4
|
+
const require_generator = require("./generator-Bz94KTkH.js");
|
|
5
5
|
require("./utils-D3h8j7Mk.js");
|
|
6
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
6
|
+
const require_tailwindcss = require("./tailwindcss-Dn5DVlkI.js");
|
|
7
7
|
require("./logger-TlKT3xmR.js");
|
|
8
8
|
let node_path = require("node:path");
|
|
9
9
|
node_path = require_rolldown_runtime.__toESM(node_path);
|
|
@@ -23,10 +23,11 @@ function shouldEnableWebCompatFromEnv() {
|
|
|
23
23
|
return uniPlatform.isWeb || uniUtsPlatform.isWeb || require_framework.resolveTaroPlatform().isWeb;
|
|
24
24
|
}
|
|
25
25
|
function withWebCompatGeneratorDefaults(options, enabled = shouldEnableWebCompatFromEnv()) {
|
|
26
|
-
if (!enabled) return options;
|
|
26
|
+
if (!enabled || options.generator === false) return options;
|
|
27
|
+
const generatorOptions = options.generator ?? {};
|
|
27
28
|
return {
|
|
28
29
|
...options,
|
|
29
|
-
generator: (0, _weapp_tailwindcss_shared.defuOverrideArray)(
|
|
30
|
+
generator: (0, _weapp_tailwindcss_shared.defuOverrideArray)(generatorOptions, {
|
|
30
31
|
target: "web",
|
|
31
32
|
webCompat: true
|
|
32
33
|
})
|
|
@@ -36,7 +37,7 @@ function createBasePreset(options = {}) {
|
|
|
36
37
|
const { base, cssEntries, resolve, rawOptions, ...userOptions } = options;
|
|
37
38
|
const baseDir = require_tailwindcss.resolveTailwindcssBasedir(base);
|
|
38
39
|
const normalizedCssEntries = normalizeCssEntries(cssEntries);
|
|
39
|
-
const tailwindConfig = { v4:
|
|
40
|
+
const tailwindConfig = { v4: require_generator.omitUndefined({
|
|
40
41
|
base: baseDir,
|
|
41
42
|
cssEntries: normalizedCssEntries
|
|
42
43
|
}) };
|
|
@@ -129,7 +130,7 @@ function uniAppX(options) {
|
|
|
129
130
|
...installedTailwindDefaults ?? {},
|
|
130
131
|
cwd: options.base,
|
|
131
132
|
resolve: resolvedResolve,
|
|
132
|
-
v4:
|
|
133
|
+
v4: require_generator.omitUndefined({
|
|
133
134
|
base: options.base,
|
|
134
135
|
cssEntries
|
|
135
136
|
})
|
package/dist/presets.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolveTaroPlatform, resolveUniPlatformsFromEnv } from "./framework.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { Pt as omitUndefined } from "./generator-ROzBodj6.mjs";
|
|
3
3
|
import { n as defuOverrideArray } from "./utils-DodxWHGz.mjs";
|
|
4
|
-
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-
|
|
4
|
+
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-hzy_WaC9.mjs";
|
|
5
5
|
import { t as logger } from "./logger-BNzxZbZj.mjs";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import process from "node:process";
|
|
@@ -17,10 +17,11 @@ function shouldEnableWebCompatFromEnv() {
|
|
|
17
17
|
return uniPlatform.isWeb || uniUtsPlatform.isWeb || resolveTaroPlatform().isWeb;
|
|
18
18
|
}
|
|
19
19
|
function withWebCompatGeneratorDefaults(options, enabled = shouldEnableWebCompatFromEnv()) {
|
|
20
|
-
if (!enabled) return options;
|
|
20
|
+
if (!enabled || options.generator === false) return options;
|
|
21
|
+
const generatorOptions = options.generator ?? {};
|
|
21
22
|
return {
|
|
22
23
|
...options,
|
|
23
|
-
generator: defuOverrideArray(
|
|
24
|
+
generator: defuOverrideArray(generatorOptions, {
|
|
24
25
|
target: "web",
|
|
25
26
|
webCompat: true
|
|
26
27
|
})
|
package/dist/rspack.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.js");
|
|
3
|
-
const require_webpack = require("./webpack-
|
|
3
|
+
const require_webpack = require("./webpack-XxBCIrBp.js");
|
|
4
4
|
let node_path = require("node:path");
|
|
5
5
|
node_path = require_rolldown_runtime.__toESM(node_path);
|
|
6
6
|
//#region src/bundlers/rspack/index.ts
|
package/dist/rspack.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as weappTailwindcssPackageDir, r as __dirname, t as WeappTailwindcss } from "./webpack-
|
|
1
|
+
import { n as weappTailwindcssPackageDir, r as __dirname, t as WeappTailwindcss } from "./webpack-CCapGlNg.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
//#region src/bundlers/rspack/index.ts
|
|
4
4
|
const CSS_IMPORT_REWRITE_LOADER_NAME = "weapp-tw-css-import-rewrite-loader";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.js");
|
|
2
2
|
const require_framework = require("./framework.js");
|
|
3
3
|
require("./auto-DtU6f3X6.js");
|
|
4
|
-
const require_context = require("./context-
|
|
5
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
6
|
-
const require_hmr_timing = require("./hmr-timing-
|
|
4
|
+
const require_context = require("./context-y2BGCok4.js");
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-Dn5DVlkI.js");
|
|
6
|
+
const require_hmr_timing = require("./hmr-timing-DOTdH18A.js");
|
|
7
7
|
let node_path = require("node:path");
|
|
8
8
|
node_path = require_rolldown_runtime.__toESM(node_path);
|
|
9
9
|
let node_process = require("node:process");
|
|
@@ -233,6 +233,7 @@ function resolvePackageDir(name) {
|
|
|
233
233
|
const BUNDLER_GENERATED_CSS_MARKER_RE = /\/\*!?\s*weapp-tailwindcss (?:vite|webpack)-generated-css(?:\s*:\s*[^\s*]+)?\s*\*\/\s*/i;
|
|
234
234
|
const BUNDLER_GENERATED_CSS_MARKER_GLOBAL_RE = /\/\*!?\s*weapp-tailwindcss (?:vite|webpack)-generated-css(?:\s*:\s*[^\s*]+)?\s*\*\/\s*/gi;
|
|
235
235
|
const BUNDLER_GENERATED_CSS_MARKER_CAPTURE_RE = /\/\*!?\s*weapp-tailwindcss (vite|webpack)-generated-css(?:\s*:\s*([^\s*]+))?\s*\*\/\s*/gi;
|
|
236
|
+
const VITE_INTERNAL_CSS_MARKER_GLOBAL_RE = /\/\*\$vite\$:\d+\*\/\s*/g;
|
|
236
237
|
function createBundlerGeneratedCssMarker(bundler, file) {
|
|
237
238
|
return `/*! weapp-tailwindcss ${bundler}-generated-css:${encodeURIComponent(file)} */`;
|
|
238
239
|
}
|
|
@@ -240,7 +241,7 @@ function hasBundlerGeneratedCssMarker(source) {
|
|
|
240
241
|
return typeof source === "string" && BUNDLER_GENERATED_CSS_MARKER_RE.test(source);
|
|
241
242
|
}
|
|
242
243
|
function stripBundlerGeneratedCssMarkers(source) {
|
|
243
|
-
return source.replace(BUNDLER_GENERATED_CSS_MARKER_GLOBAL_RE, "");
|
|
244
|
+
return source.replace(BUNDLER_GENERATED_CSS_MARKER_GLOBAL_RE, "").replace(VITE_INTERNAL_CSS_MARKER_GLOBAL_RE, "");
|
|
244
245
|
}
|
|
245
246
|
function parseBundlerGeneratedCssMarkerBlocks(source) {
|
|
246
247
|
const blocks = [];
|
|
@@ -710,6 +711,12 @@ function intersectCandidates(first, second) {
|
|
|
710
711
|
for (const candidate of small) if (large.has(candidate)) scoped.add(candidate);
|
|
711
712
|
return scoped;
|
|
712
713
|
}
|
|
714
|
+
function intersectCandidateSourceMaps(first, second) {
|
|
715
|
+
if (first.size === 0 || second.size === 0) return /* @__PURE__ */ new Map();
|
|
716
|
+
const scoped = /* @__PURE__ */ new Map();
|
|
717
|
+
for (const [candidate, sources] of first) if (second.has(candidate)) scoped.set(candidate, sources);
|
|
718
|
+
return scoped;
|
|
719
|
+
}
|
|
713
720
|
function mergeCandidates(first, second) {
|
|
714
721
|
return /* @__PURE__ */ new Set([...first, ...second]);
|
|
715
722
|
}
|
|
@@ -721,6 +728,11 @@ function resolveExplicitSourceCandidates(scopedCandidates, localCandidates, fall
|
|
|
721
728
|
if (scopedCandidates.size === 0 && localCandidates.size === 0 && fallbackCandidates?.size) return fallbackCandidates;
|
|
722
729
|
return intersectExplicitSourceCandidates(scopedCandidates, localCandidates);
|
|
723
730
|
}
|
|
731
|
+
function resolveExplicitSourceMaps(scopedSources, localSources, fallbackSources) {
|
|
732
|
+
if (scopedSources.size === 0 && localSources.size === 0 && fallbackSources?.size) return fallbackSources;
|
|
733
|
+
if (localSources.size === 0 && scopedSources.size > 0) return scopedSources;
|
|
734
|
+
return intersectCandidateSourceMaps(scopedSources, localSources);
|
|
735
|
+
}
|
|
724
736
|
function resolveScopedSourceEntries(rawSource, sourceFile, resolvedEntries) {
|
|
725
737
|
if (!hasOwnSourceDirectives(rawSource)) return {
|
|
726
738
|
entries: resolvedEntries,
|
|
@@ -736,18 +748,28 @@ function resolveScopedSourceEntries(rawSource, sourceFile, resolvedEntries) {
|
|
|
736
748
|
localEntries
|
|
737
749
|
};
|
|
738
750
|
}
|
|
751
|
+
async function resolveScopedGeneratorSourceEntries(rawSource, sourceFile) {
|
|
752
|
+
return resolveScopedSourceEntries(rawSource, sourceFile, (await require_tailwindcss.resolveTailwindV4EntriesFromCssCached(rawSource, node_path.default.dirname(node_path.default.resolve(sourceFile.replace(/[?#].*$/, "")))))?.entries);
|
|
753
|
+
}
|
|
739
754
|
async function createScopedGeneratorCandidateSignature(rawSource, sourceFile, fallbackSignature, getSourceCandidatesForEntries, options = {}) {
|
|
740
755
|
if (!getSourceCandidatesForEntries || !hasOwnSourceDirectives(rawSource)) return fallbackSignature;
|
|
741
|
-
const { entries, localEntries } =
|
|
756
|
+
const { entries, localEntries } = await resolveScopedGeneratorSourceEntries(rawSource, sourceFile);
|
|
742
757
|
if (entries === void 0) return fallbackSignature;
|
|
743
758
|
const scopedCandidates = getSourceCandidatesForEntries(entries);
|
|
744
759
|
const scopedSignature = createCandidateSignature(localEntries ? resolveExplicitSourceCandidates(scopedCandidates, getSourceCandidatesForEntries(localEntries), getSourceCandidatesForEntries(void 0)) : scopedCandidates);
|
|
745
760
|
return options.includeFallbackSignature === true ? `${scopedSignature}:${fallbackSignature}` : scopedSignature;
|
|
746
761
|
}
|
|
762
|
+
async function createScopedGeneratorSourceTraceMap(rawSource, sourceFile, getSourceCandidateSourcesForEntries) {
|
|
763
|
+
if (!getSourceCandidateSourcesForEntries || !hasOwnSourceDirectives(rawSource)) return getSourceCandidateSourcesForEntries?.(void 0);
|
|
764
|
+
const { entries, localEntries } = await resolveScopedGeneratorSourceEntries(rawSource, sourceFile);
|
|
765
|
+
if (entries === void 0) return getSourceCandidateSourcesForEntries(void 0);
|
|
766
|
+
const scopedSources = getSourceCandidateSourcesForEntries(entries);
|
|
767
|
+
return localEntries ? resolveExplicitSourceMaps(scopedSources, getSourceCandidateSourcesForEntries(localEntries), getSourceCandidateSourcesForEntries(void 0)) : scopedSources;
|
|
768
|
+
}
|
|
747
769
|
async function createScopedGeneratorRuntime(options) {
|
|
748
770
|
const { cssHandlerOptions, fallbackRuntime, getSourceCandidatesForEntries, outputFile, rawSource, shouldExcludeSubpackageSourceCandidates, sourceFile, scopedSourceCandidateGetter } = options;
|
|
749
771
|
if (getSourceCandidatesForEntries && rawSource && sourceFile) {
|
|
750
|
-
const { entries, localEntries } =
|
|
772
|
+
const { entries, localEntries } = await resolveScopedGeneratorSourceEntries(rawSource, sourceFile);
|
|
751
773
|
if (entries !== void 0 && (entries.length > 0 || hasOwnSourceDirectives(rawSource))) {
|
|
752
774
|
const scopedCandidates = scopedSourceCandidateGetter?.(entries) ?? getSourceCandidatesForEntries(entries);
|
|
753
775
|
const shouldMergeFallbackRuntime = (0, _weapp_tailwindcss_postcss.hasCssMacroTailwindV4CustomVariantConditionalComments)(rawSource);
|
|
@@ -877,6 +899,12 @@ Object.defineProperty(exports, "createScopedGeneratorRuntime", {
|
|
|
877
899
|
return createScopedGeneratorRuntime;
|
|
878
900
|
}
|
|
879
901
|
});
|
|
902
|
+
Object.defineProperty(exports, "createScopedGeneratorSourceTraceMap", {
|
|
903
|
+
enumerable: true,
|
|
904
|
+
get: function() {
|
|
905
|
+
return createScopedGeneratorSourceTraceMap;
|
|
906
|
+
}
|
|
907
|
+
});
|
|
880
908
|
Object.defineProperty(exports, "createSourceCandidateScanSignature", {
|
|
881
909
|
enumerable: true,
|
|
882
910
|
get: function() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { detectAppType } from "./framework.mjs";
|
|
2
2
|
import { n as hasCssMacroTailwindV4CustomVariantConditionalComments } from "./auto-CrJJc5rK.mjs";
|
|
3
|
-
import { g as traverse, h as babelParse, o as Parser } from "./context-
|
|
4
|
-
import { g as resolveTailwindV4EntriesFromCssCached, i as resolveUniAppXOptions } from "./tailwindcss-
|
|
5
|
-
import { u as generateCssByGenerator } from "./hmr-timing-
|
|
3
|
+
import { g as traverse, h as babelParse, o as Parser } from "./context-DzkSFEVL.mjs";
|
|
4
|
+
import { g as resolveTailwindV4EntriesFromCssCached, i as resolveUniAppXOptions } from "./tailwindcss-hzy_WaC9.mjs";
|
|
5
|
+
import { u as generateCssByGenerator } from "./hmr-timing-DwtYJdwb.mjs";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import process from "node:process";
|
|
@@ -229,6 +229,7 @@ function resolvePackageDir(name) {
|
|
|
229
229
|
const BUNDLER_GENERATED_CSS_MARKER_RE = /\/\*!?\s*weapp-tailwindcss (?:vite|webpack)-generated-css(?:\s*:\s*[^\s*]+)?\s*\*\/\s*/i;
|
|
230
230
|
const BUNDLER_GENERATED_CSS_MARKER_GLOBAL_RE = /\/\*!?\s*weapp-tailwindcss (?:vite|webpack)-generated-css(?:\s*:\s*[^\s*]+)?\s*\*\/\s*/gi;
|
|
231
231
|
const BUNDLER_GENERATED_CSS_MARKER_CAPTURE_RE = /\/\*!?\s*weapp-tailwindcss (vite|webpack)-generated-css(?:\s*:\s*([^\s*]+))?\s*\*\/\s*/gi;
|
|
232
|
+
const VITE_INTERNAL_CSS_MARKER_GLOBAL_RE = /\/\*\$vite\$:\d+\*\/\s*/g;
|
|
232
233
|
function createBundlerGeneratedCssMarker(bundler, file) {
|
|
233
234
|
return `/*! weapp-tailwindcss ${bundler}-generated-css:${encodeURIComponent(file)} */`;
|
|
234
235
|
}
|
|
@@ -236,7 +237,7 @@ function hasBundlerGeneratedCssMarker(source) {
|
|
|
236
237
|
return typeof source === "string" && BUNDLER_GENERATED_CSS_MARKER_RE.test(source);
|
|
237
238
|
}
|
|
238
239
|
function stripBundlerGeneratedCssMarkers(source) {
|
|
239
|
-
return source.replace(BUNDLER_GENERATED_CSS_MARKER_GLOBAL_RE, "");
|
|
240
|
+
return source.replace(BUNDLER_GENERATED_CSS_MARKER_GLOBAL_RE, "").replace(VITE_INTERNAL_CSS_MARKER_GLOBAL_RE, "");
|
|
240
241
|
}
|
|
241
242
|
function parseBundlerGeneratedCssMarkerBlocks(source) {
|
|
242
243
|
const blocks = [];
|
|
@@ -706,6 +707,12 @@ function intersectCandidates(first, second) {
|
|
|
706
707
|
for (const candidate of small) if (large.has(candidate)) scoped.add(candidate);
|
|
707
708
|
return scoped;
|
|
708
709
|
}
|
|
710
|
+
function intersectCandidateSourceMaps(first, second) {
|
|
711
|
+
if (first.size === 0 || second.size === 0) return /* @__PURE__ */ new Map();
|
|
712
|
+
const scoped = /* @__PURE__ */ new Map();
|
|
713
|
+
for (const [candidate, sources] of first) if (second.has(candidate)) scoped.set(candidate, sources);
|
|
714
|
+
return scoped;
|
|
715
|
+
}
|
|
709
716
|
function mergeCandidates(first, second) {
|
|
710
717
|
return /* @__PURE__ */ new Set([...first, ...second]);
|
|
711
718
|
}
|
|
@@ -717,6 +724,11 @@ function resolveExplicitSourceCandidates(scopedCandidates, localCandidates, fall
|
|
|
717
724
|
if (scopedCandidates.size === 0 && localCandidates.size === 0 && fallbackCandidates?.size) return fallbackCandidates;
|
|
718
725
|
return intersectExplicitSourceCandidates(scopedCandidates, localCandidates);
|
|
719
726
|
}
|
|
727
|
+
function resolveExplicitSourceMaps(scopedSources, localSources, fallbackSources) {
|
|
728
|
+
if (scopedSources.size === 0 && localSources.size === 0 && fallbackSources?.size) return fallbackSources;
|
|
729
|
+
if (localSources.size === 0 && scopedSources.size > 0) return scopedSources;
|
|
730
|
+
return intersectCandidateSourceMaps(scopedSources, localSources);
|
|
731
|
+
}
|
|
720
732
|
function resolveScopedSourceEntries(rawSource, sourceFile, resolvedEntries) {
|
|
721
733
|
if (!hasOwnSourceDirectives(rawSource)) return {
|
|
722
734
|
entries: resolvedEntries,
|
|
@@ -732,18 +744,28 @@ function resolveScopedSourceEntries(rawSource, sourceFile, resolvedEntries) {
|
|
|
732
744
|
localEntries
|
|
733
745
|
};
|
|
734
746
|
}
|
|
747
|
+
async function resolveScopedGeneratorSourceEntries(rawSource, sourceFile) {
|
|
748
|
+
return resolveScopedSourceEntries(rawSource, sourceFile, (await resolveTailwindV4EntriesFromCssCached(rawSource, path.dirname(path.resolve(sourceFile.replace(/[?#].*$/, "")))))?.entries);
|
|
749
|
+
}
|
|
735
750
|
async function createScopedGeneratorCandidateSignature(rawSource, sourceFile, fallbackSignature, getSourceCandidatesForEntries, options = {}) {
|
|
736
751
|
if (!getSourceCandidatesForEntries || !hasOwnSourceDirectives(rawSource)) return fallbackSignature;
|
|
737
|
-
const { entries, localEntries } =
|
|
752
|
+
const { entries, localEntries } = await resolveScopedGeneratorSourceEntries(rawSource, sourceFile);
|
|
738
753
|
if (entries === void 0) return fallbackSignature;
|
|
739
754
|
const scopedCandidates = getSourceCandidatesForEntries(entries);
|
|
740
755
|
const scopedSignature = createCandidateSignature(localEntries ? resolveExplicitSourceCandidates(scopedCandidates, getSourceCandidatesForEntries(localEntries), getSourceCandidatesForEntries(void 0)) : scopedCandidates);
|
|
741
756
|
return options.includeFallbackSignature === true ? `${scopedSignature}:${fallbackSignature}` : scopedSignature;
|
|
742
757
|
}
|
|
758
|
+
async function createScopedGeneratorSourceTraceMap(rawSource, sourceFile, getSourceCandidateSourcesForEntries) {
|
|
759
|
+
if (!getSourceCandidateSourcesForEntries || !hasOwnSourceDirectives(rawSource)) return getSourceCandidateSourcesForEntries?.(void 0);
|
|
760
|
+
const { entries, localEntries } = await resolveScopedGeneratorSourceEntries(rawSource, sourceFile);
|
|
761
|
+
if (entries === void 0) return getSourceCandidateSourcesForEntries(void 0);
|
|
762
|
+
const scopedSources = getSourceCandidateSourcesForEntries(entries);
|
|
763
|
+
return localEntries ? resolveExplicitSourceMaps(scopedSources, getSourceCandidateSourcesForEntries(localEntries), getSourceCandidateSourcesForEntries(void 0)) : scopedSources;
|
|
764
|
+
}
|
|
743
765
|
async function createScopedGeneratorRuntime(options) {
|
|
744
766
|
const { cssHandlerOptions, fallbackRuntime, getSourceCandidatesForEntries, outputFile, rawSource, shouldExcludeSubpackageSourceCandidates, sourceFile, scopedSourceCandidateGetter } = options;
|
|
745
767
|
if (getSourceCandidatesForEntries && rawSource && sourceFile) {
|
|
746
|
-
const { entries, localEntries } =
|
|
768
|
+
const { entries, localEntries } = await resolveScopedGeneratorSourceEntries(rawSource, sourceFile);
|
|
747
769
|
if (entries !== void 0 && (entries.length > 0 || hasOwnSourceDirectives(rawSource))) {
|
|
748
770
|
const scopedCandidates = scopedSourceCandidateGetter?.(entries) ?? getSourceCandidatesForEntries(entries);
|
|
749
771
|
const shouldMergeFallbackRuntime = hasCssMacroTailwindV4CustomVariantConditionalComments(rawSource);
|
|
@@ -789,4 +811,4 @@ function createSourceCandidateScanSignature(input) {
|
|
|
789
811
|
});
|
|
790
812
|
}
|
|
791
813
|
//#endregion
|
|
792
|
-
export {
|
|
814
|
+
export { createBundlerGeneratedCssMarker as A, resolveViteFrameworkProfile as B, createBundleModuleGraphOptions as C, normalizeOutputPathKey as D, stripRequestQuery as E, resolvePluginDisabledState as F, createBuiltinViteStyleInjectorPlugins as I, createBuiltinWebpackStyleInjectorPlugin as L, parseBundlerGeneratedCssMarkerBlocks as M, stripBundlerGeneratedCssMarkers as N, resolveOutputSpecifier as O, resolvePackageDir as P, viteStyleInjectorDelegates as R, applyLinkedResults as S, isSourceStyleRequest as T, resolveWebpackFrameworkProfile as V, isCSSRequest as _, createCandidateSignature as a, slash as b, getSnapshotHash as c, buildBundleSnapshot as d, classifyBundleEntry as f, formatPostcssSourceMap as g, cleanUrl as h, createScopedGeneratorSourceTraceMap as i, hasBundlerGeneratedCssMarker as j, toAbsoluteOutputPath as k, hasRuntimeAffectingSourceChanges as l, updateBundleBuildState as m, createScopedGeneratorCandidateSignature as n, createJsHashSalt as o, createBundleBuildState as p, createScopedGeneratorRuntime as r, createLinkedImpactSignature as s, createSourceCandidateScanSignature as t, summarizeStringDiff as u, isHTMLRequest as v, generateTailwindV4Css as w, createRuntimeAffectingSourceSignature as x, normalizePath as y, webpackStyleInjectorDelegates as z };
|