weapp-tailwindcss 5.5.1 → 5.5.3
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/css-imports.d.ts +1 -0
- package/dist/bundlers/shared/framework-user-css.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/output-import-shell.d.ts +6 -2
- package/dist/bundlers/shared/source-candidates/types-and-cache.d.ts +1 -1
- package/dist/bundlers/shared/v4-generation-core.d.ts +1 -0
- package/dist/bundlers/vite/frameworks/taro/index.d.ts +2 -1
- package/dist/bundlers/vite/generate-bundle/bundle-markup-candidates.d.ts +3 -2
- package/dist/bundlers/vite/generate-bundle/css-output-helpers.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/entry-style-graph.d.ts +6 -0
- package/dist/bundlers/vite/generate-bundle/runtime-configured-css.d.ts +1 -0
- package/dist/bundlers/vite/serve-js-transform.d.ts +1 -1
- package/dist/bundlers/vite/shared/create-framework-plugins.d.ts +2 -0
- package/dist/bundlers/vite/shared/framework-module-candidates.d.ts +1 -1
- package/dist/bundlers/webpack/loaders/watch-dependencies.d.ts +3 -1
- package/dist/bundlers/webpack/shared/loader-anchors.d.ts +1 -0
- package/dist/compiler/runtime-snapshot.d.ts +4 -1
- package/dist/{compiler-B0YSc0DY.js → compiler-C9X5Afn4.js} +3 -3
- package/dist/{compiler-D2ZJc3uA.cjs → compiler-DMPaUcH6.cjs} +6 -6
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{css-imports-BFMU7Hpd.cjs → css-imports-DXplvodk.cjs} +29 -0
- package/dist/{css-loader-runtime-CSv0lKqV.cjs → css-loader-runtime-DGqsWVua.cjs} +2 -1
- package/dist/{defaults-B5ep0ojb.js → defaults-CKx-4LcW.js} +1 -1
- package/dist/{defaults-BI9j1znS.cjs → defaults-CiGsr8Xq.cjs} +1 -1
- package/dist/defaults.cjs +1 -1
- package/dist/defaults.js +1 -1
- package/dist/{generator-DsrQ9txU.cjs → generator-BoZIiZD5.cjs} +130 -77
- package/dist/{generator-DyXTBPmE.js → generator-C2aWns8n.js} +119 -78
- package/dist/generator.cjs +1 -1
- package/dist/generator.js +1 -1
- package/dist/{gulp-DXeQfvVC.js → gulp-COAAztkm.js} +4 -4
- package/dist/{gulp-C9ENAx3f.cjs → gulp-D50z06nw.cjs} +5 -5
- package/dist/gulp.cjs +1 -1
- package/dist/gulp.js +1 -1
- package/dist/{hmr-timing-DNxQm-bN.js → hmr-timing-CTk1uZr9.js} +245 -183
- package/dist/{hmr-timing-Cz4IesEM.cjs → hmr-timing-DK0MJKpl.cjs} +5 -5
- package/dist/index.cjs +4 -4
- package/dist/index.js +4 -4
- package/dist/{pipeline-helpers-CSGnR5gh.cjs → pipeline-helpers-BzjYXNTa.cjs} +4 -4
- package/dist/postcss.cjs +1 -1
- package/dist/postcss.js +1 -1
- package/dist/presets.cjs +2 -2
- package/dist/presets.js +2 -2
- package/dist/rspack.cjs +6 -3
- package/dist/rspack.js +6 -3
- package/dist/{scoped-generator-kRj_5Axx.js → scoped-generator-C21A7fis.js} +3 -3
- package/dist/{scoped-generator-TVjEaOeP.cjs → scoped-generator-CTkuf9Ae.cjs} +3 -3
- package/dist/{source-candidate-scan-signature-B7cUxqqX.cjs → source-candidate-scan-signature-4mZDDaKT.cjs} +2 -2
- package/dist/{source-candidate-scan-signature-CsP4BQNa.js → source-candidate-scan-signature-BB5DfjO2.js} +2 -2
- package/dist/tailwindcss/v4-engine/css-import.d.ts +14 -0
- package/dist/{tailwindcss-C-jBBQfw.cjs → tailwindcss-Bji4u8In.cjs} +1 -1
- package/dist/{tailwindcss-BK9S7zuq.js → tailwindcss-c4PkOe1F.js} +1 -1
- package/dist/{transform-DUPOPZ54.cjs → transform-Cy0ddBWf.cjs} +14 -14
- package/dist/{transform-CfOzh007.js → transform-DmLonqPE.js} +14 -14
- package/dist/uni-app-x/border-preflight.d.ts +18 -0
- package/dist/uni-app-x/style-asset/source-parser.d.ts +2 -0
- package/dist/uni-app-x/style-reference-path.d.ts +1 -0
- package/dist/uni-app-x/transform.d.ts +2 -0
- package/dist/uni-app-x/vite/plugin-options.d.ts +2 -0
- package/dist/uni-app-x/vite/style-request.d.ts +5 -0
- package/dist/uni-app-x/vite/style-source.d.ts +14 -4
- package/dist/uni-app-x/vite/web-sfc-hmr.d.ts +14 -0
- package/dist/{v4-generation-core-CRNUU_Rr.cjs → v4-generation-core-DQeiq-g1.cjs} +243 -181
- package/dist/vite/web.cjs +1 -1
- package/dist/vite/web.js +1 -1
- package/dist/{vite-BXe-axax.js → vite-CaUxtQx5.js} +340 -88
- package/dist/{vite-D_mAIfTU.cjs → vite-OG66oLpb.cjs} +356 -85
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/dist/{watch-dependencies-DLZDrWdH.cjs → watch-dependencies-GbC14Rlt.cjs} +14 -11
- package/dist/weapp-tw-css-generation-loader.cjs +3 -2
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +11 -10
- package/dist/weapp-tw-runtime-classset-loader.cjs +16 -11
- package/dist/{web-Cv7ualrU.js → web-Bd-9OHFE.js} +7 -6
- package/dist/{web-B2Ea9K4B.cjs → web-CZKIefdl.cjs} +9 -8
- package/dist/{webpack-7Um2GFtx.js → webpack-Cyvq3H7Z.js} +38 -23
- package/dist/{webpack-Ce04-btG.cjs → webpack-DJGgU27Y.cjs} +37 -23
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.js +1 -1
- package/package.json +7 -5
package/dist/vite.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_vite = require("./vite-
|
|
2
|
+
const require_vite = require("./vite-OG66oLpb.cjs");
|
|
3
3
|
exports.WeappTailwindcss = require_vite.WeappTailwindcss;
|
|
4
4
|
exports.weappTailwindcss = require_vite.WeappTailwindcss;
|
package/dist/vite.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as WeappTailwindcss } from "./vite-
|
|
1
|
+
import { t as WeappTailwindcss } from "./vite-CaUxtQx5.js";
|
|
2
2
|
export { WeappTailwindcss, WeappTailwindcss as weappTailwindcss };
|
|
@@ -8,18 +8,21 @@ function normalizeWebpackWatchPath(file) {
|
|
|
8
8
|
}
|
|
9
9
|
function registerWebpackWatchFile(loaderContext, file) {
|
|
10
10
|
const resolved = normalizeWebpackWatchPath(file);
|
|
11
|
+
const register = (error, stats) => {
|
|
12
|
+
if (stats?.isDirectory()) loaderContext.addContextDependency?.(resolved);
|
|
13
|
+
else if (error && ["ENOENT", "ENOTDIR"].includes(error.code ?? "") && loaderContext.addMissingDependency) loaderContext.addMissingDependency(resolved);
|
|
14
|
+
else loaderContext.addDependency?.(resolved);
|
|
15
|
+
};
|
|
16
|
+
if (loaderContext.fs?.stat) return new Promise((resolve) => {
|
|
17
|
+
loaderContext.fs.stat(resolved, (error, stats) => {
|
|
18
|
+
register(error, stats);
|
|
19
|
+
resolve();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
11
22
|
try {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
loaderContext.addDependency?.(resolved);
|
|
17
|
-
} catch {
|
|
18
|
-
if (loaderContext.addMissingDependency) {
|
|
19
|
-
loaderContext.addMissingDependency(resolved);
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
loaderContext.addDependency?.(resolved);
|
|
23
|
+
register(null, (0, node_fs.statSync)(resolved));
|
|
24
|
+
} catch (error) {
|
|
25
|
+
register(error);
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
28
|
function registerWebpackWatchContext(loaderContext, context) {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
const require_generator = require("./generator-
|
|
1
|
+
const require_generator = require("./generator-BoZIiZD5.cjs");
|
|
2
|
+
const require_css_imports = require("./css-imports-DXplvodk.cjs");
|
|
2
3
|
const require_weapp_tw_css_import_rewrite_loader = require("./weapp-tw-css-import-rewrite-loader.cjs");
|
|
3
4
|
let node_buffer = require("node:buffer");
|
|
4
5
|
//#region src/bundlers/webpack/loaders/weapp-tw-css-generation-loader.ts
|
|
5
6
|
const WeappTwCssGenerationLoader = async function(source) {
|
|
6
7
|
const options = require_weapp_tw_css_import_rewrite_loader.resolveWebpackCssPipelineLoaderOptions(this.getOptions());
|
|
7
|
-
const input = node_buffer.Buffer.isBuffer(source) ? source.toString("utf-8") : source;
|
|
8
|
+
const input = require_css_imports.normalizeResolvedTailwindcssImports(node_buffer.Buffer.isBuffer(source) ? source.toString("utf-8") : source, options?.tailwindcssImportRewrite?.pkgDir);
|
|
8
9
|
if (!(require_generator.hasTailwindRootDirectives(input, { importFallback: true }) || require_generator.hasTailwindApplyDirective(input))) return source;
|
|
9
10
|
await require_weapp_tw_css_import_rewrite_loader.registerWebpackCssGeneratorSource(input, this.resourcePath, options);
|
|
10
11
|
return await require_weapp_tw_css_import_rewrite_loader.generateCssForWebpackPipeline(input, this, options) ?? source;
|
|
@@ -3,14 +3,14 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
6
|
-
const require_generator = require("./generator-
|
|
7
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
8
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
9
|
-
const require_compiler = require("./compiler-
|
|
10
|
-
const require_css_imports = require("./css-imports-
|
|
11
|
-
const require_pipeline_helpers = require("./pipeline-helpers-
|
|
6
|
+
const require_generator = require("./generator-BoZIiZD5.cjs");
|
|
7
|
+
const require_tailwindcss = require("./tailwindcss-Bji4u8In.cjs");
|
|
8
|
+
const require_v4_generation_core = require("./v4-generation-core-DQeiq-g1.cjs");
|
|
9
|
+
const require_compiler = require("./compiler-DMPaUcH6.cjs");
|
|
10
|
+
const require_css_imports = require("./css-imports-DXplvodk.cjs");
|
|
11
|
+
const require_pipeline_helpers = require("./pipeline-helpers-BzjYXNTa.cjs");
|
|
12
12
|
const require_runtime_registry = require("./runtime-registry-BlIjpImP.cjs");
|
|
13
|
-
const require_watch_dependencies = require("./watch-dependencies-
|
|
13
|
+
const require_watch_dependencies = require("./watch-dependencies-GbC14Rlt.cjs");
|
|
14
14
|
let node_path = require("node:path");
|
|
15
15
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
16
16
|
let node_process = require("node:process");
|
|
@@ -86,7 +86,7 @@ async function resolveWebpackLoaderSourceCandidates(source, loaderContext, optio
|
|
|
86
86
|
});
|
|
87
87
|
await Promise.all(scanFiles.map(async (file) => {
|
|
88
88
|
const normalizedFile = require_generator.resolveSourceScanPath(file);
|
|
89
|
-
require_watch_dependencies.registerWebpackWatchFile(loaderContext, normalizedFile);
|
|
89
|
+
await require_watch_dependencies.registerWebpackWatchFile(loaderContext, normalizedFile);
|
|
90
90
|
await collector.syncFile(normalizedFile);
|
|
91
91
|
}));
|
|
92
92
|
const candidates = collector.valuesForEntries(resolved.entries);
|
|
@@ -139,12 +139,13 @@ async function generateCssForWebpackPipeline(source, loaderContext, options) {
|
|
|
139
139
|
});
|
|
140
140
|
if (!generated) return;
|
|
141
141
|
rewriteOptions.markGeneratedCssSource?.(file);
|
|
142
|
-
for (const dependency of generated.dependencies) require_watch_dependencies.registerWebpackWatchFile(loaderContext, dependency);
|
|
142
|
+
for (const dependency of generated.dependencies) await require_watch_dependencies.registerWebpackWatchFile(loaderContext, dependency);
|
|
143
143
|
const generatedCssSource = require_generator.removeTailwindSourceDirectives(generated.css, { importFallback: true });
|
|
144
144
|
const generatedCss = (compilerOptions.cssOptions?.platform ?? compilerOptions.platform) === "lynx" ? (0, _weapp_tailwindcss_postcss.transformLynxCssCompat)(generatedCssSource) : generatedCssSource;
|
|
145
145
|
const bareUserCss = generatorTarget === "web" ? "" : require_pipeline_helpers.collectWebpackBareSelectorUserCss(normalizedSource);
|
|
146
146
|
const missingBareUserCss = bareUserCss.trim().length === 0 ? "" : (0, _weapp_tailwindcss_postcss.filterExistingCssRules)(generatedCss, bareUserCss);
|
|
147
|
-
const
|
|
147
|
+
const combinedCss = missingBareUserCss.trim().length === 0 ? generatedCss : `${generatedCss}\n${missingBareUserCss}`;
|
|
148
|
+
const css = generatorTarget === "weapp" && runtimeState.tailwindRuntime.majorVersion === 4 ? (0, _weapp_tailwindcss_postcss.normalizeTailwindcssV4InfinityRadiusCss)(combinedCss) : combinedCss;
|
|
148
149
|
if (node_process.default.env["WEAPP_TW_LOADER_DEBUG"]) node_process.default.stdout.write(`[weapp-tw-css-import-rewrite-loader] generated ${(0, node_util.inspect)({
|
|
149
150
|
classes: generated.classSet.size,
|
|
150
151
|
cssLength: css.length,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
2
|
-
const require_css_loader_runtime = require("./css-loader-runtime-
|
|
2
|
+
const require_css_loader_runtime = require("./css-loader-runtime-DGqsWVua.cjs");
|
|
3
3
|
const require_runtime_registry = require("./runtime-registry-BlIjpImP.cjs");
|
|
4
|
-
const require_watch_dependencies = require("./watch-dependencies-
|
|
4
|
+
const require_watch_dependencies = require("./watch-dependencies-GbC14Rlt.cjs");
|
|
5
5
|
let node_fs = require("node:fs");
|
|
6
6
|
let node_path = require("node:path");
|
|
7
7
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
@@ -21,7 +21,7 @@ function normalizeRuntimeCssSource(source) {
|
|
|
21
21
|
return shouldCleanRuntimeCss(source) ? cleanRuntimeCss(source) : source;
|
|
22
22
|
}
|
|
23
23
|
function shouldCleanRuntimeCss(css) {
|
|
24
|
-
return css.includes("@layer") || css.includes("@theme");
|
|
24
|
+
return !require_css_loader_runtime.isWebpackCssLoaderRuntimeSource(css) && (css.includes("@layer") || css.includes("@theme"));
|
|
25
25
|
}
|
|
26
26
|
function cleanRuntimeCss(css) {
|
|
27
27
|
const root = _weapp_tailwindcss_postcss.postcss.parse(css);
|
|
@@ -66,9 +66,10 @@ const WeappTwRuntimeClassSetLoader = function(source) {
|
|
|
66
66
|
const rawOptions = this.getOptions();
|
|
67
67
|
const opt = require_runtime_registry.getWebpackLoaderRuntime(rawOptions?.weappTailwindcssRuntimeKey)?.classSet ?? rawOptions;
|
|
68
68
|
if (this.resourcePath) {
|
|
69
|
-
|
|
69
|
+
const sourceText = node_buffer.Buffer.isBuffer(source) ? source.toString("utf8") : source;
|
|
70
|
+
if (!require_css_loader_runtime.isWebpackCssLoaderRuntimeSource(sourceText)) opt?.updateGeneratedCss?.({
|
|
70
71
|
file: this.resourcePath,
|
|
71
|
-
css:
|
|
72
|
+
css: sourceText
|
|
72
73
|
});
|
|
73
74
|
opt?.registerCssSourceFile?.({
|
|
74
75
|
file: this.resourcePath,
|
|
@@ -77,21 +78,25 @@ const WeappTwRuntimeClassSetLoader = function(source) {
|
|
|
77
78
|
}
|
|
78
79
|
const maybePromise = opt?.getClassSet?.();
|
|
79
80
|
const applyWatchDependencies = (dependencies) => {
|
|
80
|
-
|
|
81
|
+
const pending = [];
|
|
82
|
+
for (const file of dependencies?.files ?? []) {
|
|
83
|
+
const registration = require_watch_dependencies.registerWebpackWatchFile(this, file);
|
|
84
|
+
if (registration) pending.push(registration);
|
|
85
|
+
}
|
|
81
86
|
for (const context of dependencies?.contexts ?? []) require_watch_dependencies.registerWebpackWatchContext(this, context);
|
|
87
|
+
return pending.length ? Promise.all(pending).then(() => {}) : void 0;
|
|
82
88
|
};
|
|
83
89
|
const resolveWatchDependencies = () => {
|
|
84
90
|
const dependencies = opt?.getWatchDependencies?.();
|
|
85
|
-
if (isPromiseLike(dependencies)) return Promise.resolve(dependencies).then(
|
|
86
|
-
|
|
87
|
-
});
|
|
88
|
-
applyWatchDependencies(dependencies);
|
|
91
|
+
if (isPromiseLike(dependencies)) return Promise.resolve(dependencies).then(applyWatchDependencies);
|
|
92
|
+
return applyWatchDependencies(dependencies);
|
|
89
93
|
};
|
|
90
94
|
if (isPromiseLike(maybePromise)) return Promise.resolve(maybePromise).then(async () => {
|
|
91
95
|
await resolveWatchDependencies();
|
|
92
96
|
return normalizeRuntimeCssSource(source);
|
|
93
97
|
});
|
|
94
|
-
resolveWatchDependencies();
|
|
98
|
+
const watchDependencies = resolveWatchDependencies();
|
|
99
|
+
if (watchDependencies) return watchDependencies.then(() => normalizeRuntimeCssSource(source));
|
|
95
100
|
return normalizeRuntimeCssSource(source);
|
|
96
101
|
};
|
|
97
102
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { resolveImplicitAppTypeFromViteRoot } from "./framework.js";
|
|
2
|
-
import { $ as hasTailwindRootDirectives, O as resolveTailwindcssOptions, Q as hasTailwindNonRootGenerationDirectives, S as findNearestPackageRoot, W as normalizeEmptyTailwindCustomVariants, X as hasLocalCssImport, Z as hasTailwindApplyDirective, a as resolveGeneratorRuntimeBranch, at as removeTailwindSourceDirectives, b as isTailwindV4CssEntry, dt as hasTailwindGeneratedCssMarkers, et as hasTailwindSourceDirectives, ht as stripGeneratorPlaceholderMarkers, i as normalizeWeappTailwindcssGeneratorOptions, kt as resolveSourceScanPath, q as hasUserCssLayerBlocks, rt as normalizeTailwindSourceForGenerator, tt as normalizeTailwindConfigDirectives, ut as hasTailwindGeneratedCss } from "./generator-
|
|
3
|
-
import { a as findTailwindConfig, f as resolveSourceScanEntries, l as getRuntimeClassSetSignature } from "./tailwindcss-
|
|
4
|
-
import { B as createSourceCandidateCollector, C as isSourceStyleRequest, D as parseBundlerGeneratedCssMarkerBlocks, H as isSourceCandidateRequest, M as isCssSourceTraceEnabled, N as createRuntimeClassSetManager, O as stripBundlerGeneratedCssMarkers, T as createBundlerGeneratedCssMarker, W as createSourceCandidateEligibilityMatcher, g as captureFrameworkPostcssOptions, j as createCssTokenSourceMap, k as annotateCssSourceTrace,
|
|
5
|
-
import { C as createTailwindRuntimeReadyPromise, K as createDebug, S as collectRuntimeClassSet, T as refreshTailwindRuntimeState, f as getCompilerContext, g as vitePluginName, i as disposeCompilerOwner, n as createRuntimeAffectingSourceSignature, p as normalizeStyleHandlerMajorVersion, t as createCompilerRuntimeState } from "./compiler-
|
|
6
|
-
import { n as resolvePackageDir, o as normalizeStyleInjectorOptions, r as normalizeOutputPathKey, t as createSourceCandidateScanSignature } from "./source-candidate-scan-signature-
|
|
2
|
+
import { $ as hasTailwindRootDirectives, O as resolveTailwindcssOptions, Q as hasTailwindNonRootGenerationDirectives, S as findNearestPackageRoot, W as normalizeEmptyTailwindCustomVariants, X as hasLocalCssImport, Z as hasTailwindApplyDirective, a as resolveGeneratorRuntimeBranch, at as removeTailwindSourceDirectives, b as isTailwindV4CssEntry, dt as hasTailwindGeneratedCssMarkers, et as hasTailwindSourceDirectives, ht as stripGeneratorPlaceholderMarkers, i as normalizeWeappTailwindcssGeneratorOptions, kt as resolveSourceScanPath, q as hasUserCssLayerBlocks, rt as normalizeTailwindSourceForGenerator, tt as normalizeTailwindConfigDirectives, ut as hasTailwindGeneratedCss } from "./generator-C2aWns8n.js";
|
|
3
|
+
import { a as findTailwindConfig, f as resolveSourceScanEntries, l as getRuntimeClassSetSignature } from "./tailwindcss-c4PkOe1F.js";
|
|
4
|
+
import { B as createSourceCandidateCollector, C as isSourceStyleRequest, D as parseBundlerGeneratedCssMarkerBlocks, H as isSourceCandidateRequest, M as isCssSourceTraceEnabled, N as createRuntimeClassSetManager, O as stripBundlerGeneratedCssMarkers, T as createBundlerGeneratedCssMarker, W as createSourceCandidateEligibilityMatcher, f as scoreTailwindV4CssSourceFileMatch, g as captureFrameworkPostcssOptions, j as createCssTokenSourceMap, k as annotateCssSourceTrace, r as generateTailwindV4Css, t as createHmrTimingRecorder, w as stripRequestQuery, z as finalizeCompilerShadowRun } from "./hmr-timing-CTk1uZr9.js";
|
|
5
|
+
import { C as createTailwindRuntimeReadyPromise, K as createDebug, S as collectRuntimeClassSet, T as refreshTailwindRuntimeState, f as getCompilerContext, g as vitePluginName, i as disposeCompilerOwner, n as createRuntimeAffectingSourceSignature, p as normalizeStyleHandlerMajorVersion, t as createCompilerRuntimeState } from "./compiler-C9X5Afn4.js";
|
|
6
|
+
import { n as resolvePackageDir, o as normalizeStyleInjectorOptions, r as normalizeOutputPathKey, t as createSourceCandidateScanSignature } from "./source-candidate-scan-signature-BB5DfjO2.js";
|
|
7
7
|
import { existsSync, realpathSync } from "node:fs";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import process$1 from "node:process";
|
|
@@ -353,7 +353,8 @@ function resolveStyleOutputExtensionFromFiles(files, cssMatcher, stem) {
|
|
|
353
353
|
}
|
|
354
354
|
function resolveStyleOutputExtensionFromMatcher(cssMatcher, stem) {
|
|
355
355
|
if (!cssMatcher || !stem) return;
|
|
356
|
-
|
|
356
|
+
const extensions = COMMON_MINI_PROGRAM_STYLE_OUTPUT_EXTENSIONS.filter((extension) => cssMatcher(`${stem}${extension}`));
|
|
357
|
+
return extensions.length === 1 ? extensions[0] : void 0;
|
|
357
358
|
}
|
|
358
359
|
function resolveStyleOutputFileFromFiles(files, cssMatcher, stem) {
|
|
359
360
|
const cleanStem = normalizeOutputPathKey(stem);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
2
2
|
const require_framework = require("./framework.cjs");
|
|
3
|
-
const require_generator = require("./generator-
|
|
4
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
5
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
6
|
-
const require_compiler = require("./compiler-
|
|
3
|
+
const require_generator = require("./generator-BoZIiZD5.cjs");
|
|
4
|
+
const require_tailwindcss = require("./tailwindcss-Bji4u8In.cjs");
|
|
5
|
+
const require_v4_generation_core = require("./v4-generation-core-DQeiq-g1.cjs");
|
|
6
|
+
const require_compiler = require("./compiler-DMPaUcH6.cjs");
|
|
7
7
|
const require_runtime_state = require("./runtime-state-BBQcA0n5.cjs");
|
|
8
|
-
const require_hmr_timing = require("./hmr-timing-
|
|
9
|
-
const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-
|
|
10
|
-
const require_css_imports = require("./css-imports-
|
|
8
|
+
const require_hmr_timing = require("./hmr-timing-DK0MJKpl.cjs");
|
|
9
|
+
const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-4mZDDaKT.cjs");
|
|
10
|
+
const require_css_imports = require("./css-imports-DXplvodk.cjs");
|
|
11
11
|
let node_fs = require("node:fs");
|
|
12
12
|
let node_path = require("node:path");
|
|
13
13
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
@@ -359,7 +359,8 @@ function resolveStyleOutputExtensionFromFiles(files, cssMatcher, stem) {
|
|
|
359
359
|
}
|
|
360
360
|
function resolveStyleOutputExtensionFromMatcher(cssMatcher, stem) {
|
|
361
361
|
if (!cssMatcher || !stem) return;
|
|
362
|
-
|
|
362
|
+
const extensions = COMMON_MINI_PROGRAM_STYLE_OUTPUT_EXTENSIONS.filter((extension) => cssMatcher(`${stem}${extension}`));
|
|
363
|
+
return extensions.length === 1 ? extensions[0] : void 0;
|
|
363
364
|
}
|
|
364
365
|
function resolveStyleOutputFileFromFiles(files, cssMatcher, stem) {
|
|
365
366
|
const cleanStem = require_source_candidate_scan_signature.normalizeOutputPathKey(stem);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { $ as hasTailwindRootDirectives, F as stripTailwindSourceMediaFragments, H as removeTailwindV4GeneratedUserCssArtifacts, I as stripUnmatchedTailwindSourceMediaCloseFragments,
|
|
2
|
-
import { f as resolveSourceScanEntries, g as resolveTailwindV4EntriesFromCssCached, l as getRuntimeClassSetSignature } from "./tailwindcss-
|
|
1
|
+
import { $ as hasTailwindRootDirectives, F as stripTailwindSourceMediaFragments, H as removeTailwindV4GeneratedUserCssArtifacts, I as stripUnmatchedTailwindSourceMediaCloseFragments, L as finalizeMiniProgramCss$1, M as isCommentOnlyCss, Mt as _defineProperty, N as removeMiniProgramInteractiveSelectors, O as resolveTailwindcssOptions, P as removeTailwindV4GeneratorAtRules, Rt as getTailwindV4IncrementalGenerateCacheStats, V as stripMiniProgramCssSpecificityPlaceholders, Z as hasTailwindApplyDirective, _ as upsertTailwindV4CssSource, at as removeTailwindSourceDirectives, dt as hasTailwindGeneratedCssMarkers, et as hasTailwindSourceDirectives, h as hasConfiguredTailwindV4CssRoots, i as normalizeWeappTailwindcssGeneratorOptions, it as parseImportRequest, kt as resolveSourceScanPath, o as resolveRuntimeBranch, tt as normalizeTailwindConfigDirectives, ut as hasTailwindGeneratedCss, z as pruneMiniProgramGeneratedCss } from "./generator-C2aWns8n.js";
|
|
2
|
+
import { f as resolveSourceScanEntries, g as resolveTailwindV4EntriesFromCssCached, l as getRuntimeClassSetSignature } from "./tailwindcss-c4PkOe1F.js";
|
|
3
3
|
import { r as getGroupedEntries } from "./utils-MVwpU07P.js";
|
|
4
|
-
import { A as createCssSourceTraceCacheSignature, C as isSourceStyleRequest, E as hasBundlerGeneratedCssMarker, F as createEscapeFragments, G as resolveSourceCandidateScanFiles, H as isSourceCandidateRequest, I as isPureLocalCssImportWrapper, M as isCssSourceTraceEnabled, N as createRuntimeClassSetManager, O as stripBundlerGeneratedCssMarkers, P as collectStrictEscapedRuntimeCandidates, V as createSourceCandidateStore, _ as captureResolvedFrameworkPostcssOptions, c as
|
|
5
|
-
import { C as createTailwindRuntimeReadyPromise, K as createDebug, L as createCompilationDependencyChanges, N as recordCompilationDependencyChanges, O as AssetEmissionPlan, T as refreshTailwindRuntimeState, Y as md5Hash, a as beginCompilerShadowRun, f as getCompilerContext, h as pluginName, i as disposeCompilerOwner, j as getCompilationScopeDependencyRevision, m as resolveStyleOptionsFromContext, n as createRuntimeAffectingSourceSignature, p as normalizeStyleHandlerMajorVersion, t as createCompilerRuntimeState, v as shouldSkipJsTransform, w as ensureRuntimeClassSet } from "./compiler-
|
|
6
|
-
import { n as getDefaultCssPreflight } from "./defaults-
|
|
4
|
+
import { A as createCssSourceTraceCacheSignature, C as isSourceStyleRequest, E as hasBundlerGeneratedCssMarker, F as createEscapeFragments, G as resolveSourceCandidateScanFiles, H as isSourceCandidateRequest, I as isPureLocalCssImportWrapper, M as isCssSourceTraceEnabled, N as createRuntimeClassSetManager, O as stripBundlerGeneratedCssMarkers, P as collectStrictEscapedRuntimeCandidates, V as createSourceCandidateStore, _ as captureResolvedFrameworkPostcssOptions, c as resolveTaskConcurrency, f as scoreTailwindV4CssSourceFileMatch, j as createCssTokenSourceMap, k as annotateCssSourceTrace, n as emitHmrTiming, o as collectRawSourceClassSelectors, p as removeGeneratedSelectorCompatCss, r as generateTailwindV4Css, s as pushConcurrentTaskFactories, v as collectFrameworkPostcssOptionsFromLoaderEntries, w as stripRequestQuery, x as hasMiniProgramTailwindV4PreflightReset, y as createCssSourceOrderAppend, z as finalizeCompilerShadowRun } from "./hmr-timing-CTk1uZr9.js";
|
|
5
|
+
import { C as createTailwindRuntimeReadyPromise, K as createDebug, L as createCompilationDependencyChanges, N as recordCompilationDependencyChanges, O as AssetEmissionPlan, T as refreshTailwindRuntimeState, Y as md5Hash, a as beginCompilerShadowRun, f as getCompilerContext, h as pluginName, i as disposeCompilerOwner, j as getCompilationScopeDependencyRevision, m as resolveStyleOptionsFromContext, n as createRuntimeAffectingSourceSignature, p as normalizeStyleHandlerMajorVersion, t as createCompilerRuntimeState, v as shouldSkipJsTransform, w as ensureRuntimeClassSet } from "./compiler-C9X5Afn4.js";
|
|
6
|
+
import { n as getDefaultCssPreflight } from "./defaults-CKx-4LcW.js";
|
|
7
7
|
import { a as createRuntimeCompilationAffectingSignature, c as resetRuntimeCompilationBuildState, i as buildRuntimeCompilationSnapshot, l as updateRuntimeCompilationBuildState, o as createRuntimeCompilationBuildState, r as processCachedTask, t as finalizeMiniProgramCssStructure } from "./final-css-cleanup-B0HUBtiE.js";
|
|
8
|
-
import { _ as resolveWebpackFrameworkProfile, d as resolvePluginDisabledState, h as webpackStyleInjectorDelegates, i as createCandidateSignature, n as createScopedGeneratorRuntime, p as createBuiltinWebpackStyleInjectorPlugin, u as classifyRuntimeEntry } from "./scoped-generator-
|
|
9
|
-
import { a as toAbsoluteOutputPath, i as resolveOutputSpecifier, n as resolvePackageDir, t as createSourceCandidateScanSignature } from "./source-candidate-scan-signature-
|
|
8
|
+
import { _ as resolveWebpackFrameworkProfile, d as resolvePluginDisabledState, h as webpackStyleInjectorDelegates, i as createCandidateSignature, n as createScopedGeneratorRuntime, p as createBuiltinWebpackStyleInjectorPlugin, u as classifyRuntimeEntry } from "./scoped-generator-C21A7fis.js";
|
|
9
|
+
import { a as toAbsoluteOutputPath, i as resolveOutputSpecifier, n as resolvePackageDir, t as createSourceCandidateScanSignature } from "./source-candidate-scan-signature-BB5DfjO2.js";
|
|
10
10
|
import Module, { createRequire } from "node:module";
|
|
11
11
|
import fs from "node:fs";
|
|
12
12
|
import path from "node:path";
|
|
@@ -1268,7 +1268,8 @@ async function finalizeWebpackProcessAssets(context) {
|
|
|
1268
1268
|
//#endregion
|
|
1269
1269
|
//#region src/bundlers/webpack/shared/css-loader-runtime.ts
|
|
1270
1270
|
function isWebpackCssLoaderRuntimeSource(source) {
|
|
1271
|
-
|
|
1271
|
+
if (source.trimStart().startsWith("// extracted by mini-css-extract-plugin")) return true;
|
|
1272
|
+
return source.includes("___CSS_LOADER_EXPORT___") && source.includes("___CSS_LOADER_API_IMPORT___") && (source.includes("module.exports = ___CSS_LOADER_EXPORT___") || source.includes("export default ___CSS_LOADER_EXPORT___"));
|
|
1272
1273
|
}
|
|
1273
1274
|
//#endregion
|
|
1274
1275
|
//#region src/bundlers/webpack/BaseUnifiedPlugin/v5-assets/generated-css-result.ts
|
|
@@ -2497,7 +2498,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
2497
2498
|
});
|
|
2498
2499
|
}
|
|
2499
2500
|
//#endregion
|
|
2500
|
-
//#region ../../node_modules/.pnpm/tsdown@0.
|
|
2501
|
+
//#region ../../node_modules/.pnpm/tsdown@0.23.0_@volar+typescript@2.4.28_typescript@6.0.3__oxc-resolver@11.21.2_tsx@4.23._4e52ff524057c5ff1c5c2a05b9148d99/node_modules/tsdown/esm-shims.js
|
|
2501
2502
|
const getFilename = () => fileURLToPath(import.meta.url);
|
|
2502
2503
|
const getDirname = () => path.dirname(getFilename());
|
|
2503
2504
|
const __dirname = /* @__PURE__ */ getDirname();
|
|
@@ -2863,6 +2864,10 @@ function deleteWebpackLoaderRuntime(key) {
|
|
|
2863
2864
|
}
|
|
2864
2865
|
//#endregion
|
|
2865
2866
|
//#region src/bundlers/webpack/shared/loader-anchors.ts
|
|
2867
|
+
const CSS_PREPROCESSOR_RE = /(?:^|[/\\])(?:sass|less|stylus)-loader(?:[/\\]|(?:\.[cm]?js)?$)/;
|
|
2868
|
+
function findCssPreprocessorIndex(entries) {
|
|
2869
|
+
return entries.findIndex((entry) => CSS_PREPROCESSOR_RE.test(entry.loader ?? ""));
|
|
2870
|
+
}
|
|
2866
2871
|
const MPX_STRIP_CONDITIONAL_LOADER = "@mpxjs/webpack-plugin/lib/style-compiler/strip-conditional-loader";
|
|
2867
2872
|
const MPX_STYLE_COMPILER_LOADER = "@mpxjs/webpack-plugin/lib/style-compiler/index";
|
|
2868
2873
|
const MPX_REWRITE_PRECEDENCE_LOADERS = [MPX_STYLE_COMPILER_LOADER, MPX_STRIP_CONDITIONAL_LOADER];
|
|
@@ -2885,7 +2890,7 @@ function createMpxLoaderAnchorFinders() {
|
|
|
2885
2890
|
};
|
|
2886
2891
|
}
|
|
2887
2892
|
function createDefaultLoaderAnchorFinders() {
|
|
2888
|
-
const fallbackFinder =
|
|
2893
|
+
const fallbackFinder = createPrioritizedFinder(["postcss-loader", "css-loader"]);
|
|
2889
2894
|
return {
|
|
2890
2895
|
findRewriteAnchor: fallbackFinder,
|
|
2891
2896
|
findClassSetAnchor: fallbackFinder
|
|
@@ -3003,8 +3008,9 @@ function setupWebpackV5Loaders(options) {
|
|
|
3003
3008
|
classSetAnchorIdx
|
|
3004
3009
|
});
|
|
3005
3010
|
if (rewriteAnchorIdx === -1 && classSetAnchorIdx === -1 && !isCssModule) return;
|
|
3011
|
+
const preprocessorIndex = findCssPreprocessorIndex(loaderEntries);
|
|
3006
3012
|
const anchorlessInsert = (entry, position) => {
|
|
3007
|
-
if (position === "after") loaderEntries.
|
|
3013
|
+
if (position === "after") loaderEntries.splice(preprocessorIndex === -1 ? loaderEntries.length : preprocessorIndex, 0, entry);
|
|
3008
3014
|
else loaderEntries.unshift(entry);
|
|
3009
3015
|
};
|
|
3010
3016
|
if (cssGenerationLoaderOptions && runtimeCssGenerationLoaderExists && runtimeCssGenerationLoader && isCssModule && !isLynxMainThreadCss && !hasLoaderEntry(loaderEntries, runtimeCssGenerationLoader)) {
|
|
@@ -3017,10 +3023,15 @@ function setupWebpackV5Loaders(options) {
|
|
|
3017
3023
|
}
|
|
3018
3024
|
if (cssImportRewriteLoaderOptions && runtimeCssImportRewriteLoaderExists && runtimeCssImportRewriteLoader && isCssModule && !isLynxMainThreadCss) {
|
|
3019
3025
|
const existingIndex = loaderEntries.findIndex((entry) => entry.loader?.includes?.(runtimeCssImportRewriteLoader));
|
|
3026
|
+
const existingOptions = existingIndex === -1 ? void 0 : loaderEntries[existingIndex]?.options;
|
|
3027
|
+
const generateInRegisteredLoader = typeof existingOptions === "object" && existingOptions !== null && "generateCss" in existingOptions && existingOptions.generateCss === true;
|
|
3020
3028
|
const rewriteLoaderEntry = existingIndex !== -1 ? {
|
|
3021
3029
|
...loaderEntries.splice(existingIndex, 1)[0],
|
|
3022
3030
|
loader: runtimeCssImportRewriteLoader,
|
|
3023
|
-
options:
|
|
3031
|
+
options: {
|
|
3032
|
+
...cssImportRewriteLoaderOptions,
|
|
3033
|
+
generateCss: cssImportRewriteLoaderOptions.generateCss || generateInRegisteredLoader
|
|
3034
|
+
}
|
|
3024
3035
|
} : createCssImportRewriteLoaderEntry();
|
|
3025
3036
|
if (rewriteLoaderEntry) {
|
|
3026
3037
|
const anchorIndex = findRewriteAnchor(loaderEntries);
|
|
@@ -3050,18 +3061,23 @@ function shouldKeepPreviousWebpackCssSource(previous, next) {
|
|
|
3050
3061
|
return next.processed === true && previous.processed === false;
|
|
3051
3062
|
}
|
|
3052
3063
|
function normalizeIgnoredList(ignored) {
|
|
3053
|
-
return (Array.isArray(ignored) ? [...ignored] : [ignored]).filter((item) => typeof item === "string" || item instanceof RegExp || typeof item === "function");
|
|
3064
|
+
return (Array.isArray(ignored) ? [...ignored] : [ignored]).filter((item) => typeof item === "string" && item.length > 0 || item instanceof RegExp || typeof item === "function");
|
|
3054
3065
|
}
|
|
3055
3066
|
function createOutputIgnoredPredicate(ignoredList, ignoredPath) {
|
|
3067
|
+
const paths = path.win32.isAbsolute(ignoredPath) && !path.posix.isAbsolute(ignoredPath) ? path.win32 : path;
|
|
3068
|
+
const contains = (directory, file) => {
|
|
3069
|
+
const relative = paths.relative(directory, file);
|
|
3070
|
+
return relative === "" || relative !== ".." && !relative.startsWith(`..${paths.sep}`) && !paths.isAbsolute(relative);
|
|
3071
|
+
};
|
|
3056
3072
|
const predicate = (file) => {
|
|
3057
|
-
const resolvedFile =
|
|
3058
|
-
if (
|
|
3073
|
+
const resolvedFile = paths.resolve(file);
|
|
3074
|
+
if (contains(ignoredPath, resolvedFile)) return true;
|
|
3059
3075
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
3060
3076
|
return ignoredList.some((item) => {
|
|
3061
3077
|
if (typeof item === "string") {
|
|
3062
|
-
const resolvedItem =
|
|
3063
|
-
if (
|
|
3064
|
-
return micromatch.isMatch(normalizedFile, item);
|
|
3078
|
+
const resolvedItem = paths.resolve(item);
|
|
3079
|
+
if (contains(resolvedItem, resolvedFile)) return true;
|
|
3080
|
+
return micromatch.isMatch(normalizedFile, [item, `${item}/**`], { dot: true });
|
|
3065
3081
|
}
|
|
3066
3082
|
if (item instanceof RegExp) return item.test(normalizedFile);
|
|
3067
3083
|
return item(file);
|
|
@@ -3072,15 +3088,13 @@ function createOutputIgnoredPredicate(ignoredList, ignoredPath) {
|
|
|
3072
3088
|
}
|
|
3073
3089
|
function appendIgnoredPath(ignored, ignoredPath) {
|
|
3074
3090
|
if (typeof ignored === "function" && ignored[outputIgnoredPredicatePath] === ignoredPath) return ignored;
|
|
3075
|
-
|
|
3076
|
-
if (ignoredList.some((item) => typeof item !== "string")) return createOutputIgnoredPredicate(ignoredList, ignoredPath);
|
|
3077
|
-
if (ignoredList.some((item) => typeof item === "string" && path.resolve(item) === ignoredPath)) return ignored;
|
|
3078
|
-
return [...ignoredList, ignoredPath];
|
|
3091
|
+
return createOutputIgnoredPredicate(normalizeIgnoredList(ignored), ignoredPath);
|
|
3079
3092
|
}
|
|
3080
3093
|
function setupWebpackWatchOutputIgnore(compiler) {
|
|
3081
3094
|
const appendOutputIgnoredPath = (watchOptions, outputPath) => {
|
|
3082
3095
|
const resolvedOutputPath = outputPath || compiler.outputPath || compiler.options?.output?.path;
|
|
3083
|
-
const
|
|
3096
|
+
const paths = resolvedOutputPath && path.win32.isAbsolute(resolvedOutputPath) && !path.posix.isAbsolute(resolvedOutputPath) ? path.win32 : path;
|
|
3097
|
+
const outputDir = resolvedOutputPath ? paths.resolve(resolvedOutputPath) : void 0;
|
|
3084
3098
|
if (!outputDir) return watchOptions;
|
|
3085
3099
|
if (watchOptions && typeof watchOptions === "object") {
|
|
3086
3100
|
const nextIgnored = appendIgnoredPath(watchOptions.ignored, outputDir);
|
|
@@ -3210,6 +3224,7 @@ var WebpackFrameworkPlugin = class {
|
|
|
3210
3224
|
const syncRuntimeRefreshRequirement = (markWatchRun = false) => {
|
|
3211
3225
|
if (markWatchRun) watchRunObserved = true;
|
|
3212
3226
|
const changedFiles = collectWatchChangedFiles();
|
|
3227
|
+
if (markWatchRun && debug.enabled) debug("webpack watch changed files=%O", [...changedFiles]);
|
|
3213
3228
|
runtimeRefreshRequiredForCompilation = runtimeRefreshRequiredForCompilation || hasRuntimeDependencyChanges(changedFiles);
|
|
3214
3229
|
};
|
|
3215
3230
|
const resetRuntimePreparation = () => {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
2
|
-
const require_generator = require("./generator-
|
|
3
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
2
|
+
const require_generator = require("./generator-BoZIiZD5.cjs");
|
|
3
|
+
const require_tailwindcss = require("./tailwindcss-Bji4u8In.cjs");
|
|
4
4
|
const require_utils = require("./utils-CuKLf1Zv.cjs");
|
|
5
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
6
|
-
const require_compiler = require("./compiler-
|
|
5
|
+
const require_v4_generation_core = require("./v4-generation-core-DQeiq-g1.cjs");
|
|
6
|
+
const require_compiler = require("./compiler-DMPaUcH6.cjs");
|
|
7
7
|
const require_runtime_state = require("./runtime-state-BBQcA0n5.cjs");
|
|
8
8
|
const require_cache = require("./cache-CBJFB1HN.cjs");
|
|
9
|
-
const require_hmr_timing = require("./hmr-timing-
|
|
10
|
-
const require_scoped_generator = require("./scoped-generator-
|
|
11
|
-
const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-
|
|
12
|
-
const require_pipeline_helpers = require("./pipeline-helpers-
|
|
13
|
-
const require_css_loader_runtime = require("./css-loader-runtime-
|
|
9
|
+
const require_hmr_timing = require("./hmr-timing-DK0MJKpl.cjs");
|
|
10
|
+
const require_scoped_generator = require("./scoped-generator-CTkuf9Ae.cjs");
|
|
11
|
+
const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-4mZDDaKT.cjs");
|
|
12
|
+
const require_pipeline_helpers = require("./pipeline-helpers-BzjYXNTa.cjs");
|
|
13
|
+
const require_css_loader_runtime = require("./css-loader-runtime-DGqsWVua.cjs");
|
|
14
14
|
const require_runtime_registry = require("./runtime-registry-BlIjpImP.cjs");
|
|
15
15
|
let node_fs = require("node:fs");
|
|
16
16
|
node_fs = require_rolldown_runtime.__toESM(node_fs, 1);
|
|
@@ -2103,6 +2103,10 @@ function injectMpxCssRewritePreRules(compiler, loader, loaderOptions) {
|
|
|
2103
2103
|
}
|
|
2104
2104
|
//#endregion
|
|
2105
2105
|
//#region src/bundlers/webpack/shared/loader-anchors.ts
|
|
2106
|
+
const CSS_PREPROCESSOR_RE = /(?:^|[/\\])(?:sass|less|stylus)-loader(?:[/\\]|(?:\.[cm]?js)?$)/;
|
|
2107
|
+
function findCssPreprocessorIndex(entries) {
|
|
2108
|
+
return entries.findIndex((entry) => CSS_PREPROCESSOR_RE.test(entry.loader ?? ""));
|
|
2109
|
+
}
|
|
2106
2110
|
const MPX_STRIP_CONDITIONAL_LOADER = "@mpxjs/webpack-plugin/lib/style-compiler/strip-conditional-loader";
|
|
2107
2111
|
const MPX_STYLE_COMPILER_LOADER = "@mpxjs/webpack-plugin/lib/style-compiler/index";
|
|
2108
2112
|
const MPX_REWRITE_PRECEDENCE_LOADERS = [MPX_STYLE_COMPILER_LOADER, MPX_STRIP_CONDITIONAL_LOADER];
|
|
@@ -2125,7 +2129,7 @@ function createMpxLoaderAnchorFinders() {
|
|
|
2125
2129
|
};
|
|
2126
2130
|
}
|
|
2127
2131
|
function createDefaultLoaderAnchorFinders() {
|
|
2128
|
-
const fallbackFinder =
|
|
2132
|
+
const fallbackFinder = createPrioritizedFinder(["postcss-loader", "css-loader"]);
|
|
2129
2133
|
return {
|
|
2130
2134
|
findRewriteAnchor: fallbackFinder,
|
|
2131
2135
|
findClassSetAnchor: fallbackFinder
|
|
@@ -2244,8 +2248,9 @@ function setupWebpackV5Loaders(options) {
|
|
|
2244
2248
|
classSetAnchorIdx
|
|
2245
2249
|
});
|
|
2246
2250
|
if (rewriteAnchorIdx === -1 && classSetAnchorIdx === -1 && !isCssModule) return;
|
|
2251
|
+
const preprocessorIndex = findCssPreprocessorIndex(loaderEntries);
|
|
2247
2252
|
const anchorlessInsert = (entry, position) => {
|
|
2248
|
-
if (position === "after") loaderEntries.
|
|
2253
|
+
if (position === "after") loaderEntries.splice(preprocessorIndex === -1 ? loaderEntries.length : preprocessorIndex, 0, entry);
|
|
2249
2254
|
else loaderEntries.unshift(entry);
|
|
2250
2255
|
};
|
|
2251
2256
|
if (cssGenerationLoaderOptions && runtimeCssGenerationLoaderExists && runtimeCssGenerationLoader && isCssModule && !isLynxMainThreadCss && !hasLoaderEntry(loaderEntries, runtimeCssGenerationLoader)) {
|
|
@@ -2258,10 +2263,15 @@ function setupWebpackV5Loaders(options) {
|
|
|
2258
2263
|
}
|
|
2259
2264
|
if (cssImportRewriteLoaderOptions && runtimeCssImportRewriteLoaderExists && runtimeCssImportRewriteLoader && isCssModule && !isLynxMainThreadCss) {
|
|
2260
2265
|
const existingIndex = loaderEntries.findIndex((entry) => entry.loader?.includes?.(runtimeCssImportRewriteLoader));
|
|
2266
|
+
const existingOptions = existingIndex === -1 ? void 0 : loaderEntries[existingIndex]?.options;
|
|
2267
|
+
const generateInRegisteredLoader = typeof existingOptions === "object" && existingOptions !== null && "generateCss" in existingOptions && existingOptions.generateCss === true;
|
|
2261
2268
|
const rewriteLoaderEntry = existingIndex !== -1 ? {
|
|
2262
2269
|
...loaderEntries.splice(existingIndex, 1)[0],
|
|
2263
2270
|
loader: runtimeCssImportRewriteLoader,
|
|
2264
|
-
options:
|
|
2271
|
+
options: {
|
|
2272
|
+
...cssImportRewriteLoaderOptions,
|
|
2273
|
+
generateCss: cssImportRewriteLoaderOptions.generateCss || generateInRegisteredLoader
|
|
2274
|
+
}
|
|
2265
2275
|
} : createCssImportRewriteLoaderEntry();
|
|
2266
2276
|
if (rewriteLoaderEntry) {
|
|
2267
2277
|
const anchorIndex = findRewriteAnchor(loaderEntries);
|
|
@@ -2291,18 +2301,23 @@ function shouldKeepPreviousWebpackCssSource(previous, next) {
|
|
|
2291
2301
|
return next.processed === true && previous.processed === false;
|
|
2292
2302
|
}
|
|
2293
2303
|
function normalizeIgnoredList(ignored) {
|
|
2294
|
-
return (Array.isArray(ignored) ? [...ignored] : [ignored]).filter((item) => typeof item === "string" || item instanceof RegExp || typeof item === "function");
|
|
2304
|
+
return (Array.isArray(ignored) ? [...ignored] : [ignored]).filter((item) => typeof item === "string" && item.length > 0 || item instanceof RegExp || typeof item === "function");
|
|
2295
2305
|
}
|
|
2296
2306
|
function createOutputIgnoredPredicate(ignoredList, ignoredPath) {
|
|
2307
|
+
const paths = node_path.default.win32.isAbsolute(ignoredPath) && !node_path.default.posix.isAbsolute(ignoredPath) ? node_path.default.win32 : node_path.default;
|
|
2308
|
+
const contains = (directory, file) => {
|
|
2309
|
+
const relative = paths.relative(directory, file);
|
|
2310
|
+
return relative === "" || relative !== ".." && !relative.startsWith(`..${paths.sep}`) && !paths.isAbsolute(relative);
|
|
2311
|
+
};
|
|
2297
2312
|
const predicate = (file) => {
|
|
2298
|
-
const resolvedFile =
|
|
2299
|
-
if (
|
|
2313
|
+
const resolvedFile = paths.resolve(file);
|
|
2314
|
+
if (contains(ignoredPath, resolvedFile)) return true;
|
|
2300
2315
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
2301
2316
|
return ignoredList.some((item) => {
|
|
2302
2317
|
if (typeof item === "string") {
|
|
2303
|
-
const resolvedItem =
|
|
2304
|
-
if (
|
|
2305
|
-
return micromatch.default.isMatch(normalizedFile, item);
|
|
2318
|
+
const resolvedItem = paths.resolve(item);
|
|
2319
|
+
if (contains(resolvedItem, resolvedFile)) return true;
|
|
2320
|
+
return micromatch.default.isMatch(normalizedFile, [item, `${item}/**`], { dot: true });
|
|
2306
2321
|
}
|
|
2307
2322
|
if (item instanceof RegExp) return item.test(normalizedFile);
|
|
2308
2323
|
return item(file);
|
|
@@ -2313,15 +2328,13 @@ function createOutputIgnoredPredicate(ignoredList, ignoredPath) {
|
|
|
2313
2328
|
}
|
|
2314
2329
|
function appendIgnoredPath(ignored, ignoredPath) {
|
|
2315
2330
|
if (typeof ignored === "function" && ignored[outputIgnoredPredicatePath] === ignoredPath) return ignored;
|
|
2316
|
-
|
|
2317
|
-
if (ignoredList.some((item) => typeof item !== "string")) return createOutputIgnoredPredicate(ignoredList, ignoredPath);
|
|
2318
|
-
if (ignoredList.some((item) => typeof item === "string" && node_path.default.resolve(item) === ignoredPath)) return ignored;
|
|
2319
|
-
return [...ignoredList, ignoredPath];
|
|
2331
|
+
return createOutputIgnoredPredicate(normalizeIgnoredList(ignored), ignoredPath);
|
|
2320
2332
|
}
|
|
2321
2333
|
function setupWebpackWatchOutputIgnore(compiler) {
|
|
2322
2334
|
const appendOutputIgnoredPath = (watchOptions, outputPath) => {
|
|
2323
2335
|
const resolvedOutputPath = outputPath || compiler.outputPath || compiler.options?.output?.path;
|
|
2324
|
-
const
|
|
2336
|
+
const paths = resolvedOutputPath && node_path.default.win32.isAbsolute(resolvedOutputPath) && !node_path.default.posix.isAbsolute(resolvedOutputPath) ? node_path.default.win32 : node_path.default;
|
|
2337
|
+
const outputDir = resolvedOutputPath ? paths.resolve(resolvedOutputPath) : void 0;
|
|
2325
2338
|
if (!outputDir) return watchOptions;
|
|
2326
2339
|
if (watchOptions && typeof watchOptions === "object") {
|
|
2327
2340
|
const nextIgnored = appendIgnoredPath(watchOptions.ignored, outputDir);
|
|
@@ -2451,6 +2464,7 @@ var WebpackFrameworkPlugin = class {
|
|
|
2451
2464
|
const syncRuntimeRefreshRequirement = (markWatchRun = false) => {
|
|
2452
2465
|
if (markWatchRun) watchRunObserved = true;
|
|
2453
2466
|
const changedFiles = collectWatchChangedFiles();
|
|
2467
|
+
if (markWatchRun && debug.enabled) debug("webpack watch changed files=%O", [...changedFiles]);
|
|
2454
2468
|
runtimeRefreshRequiredForCompilation = runtimeRefreshRequiredForCompilation || hasRuntimeDependencyChanges(changedFiles);
|
|
2455
2469
|
};
|
|
2456
2470
|
const resetRuntimePreparation = () => {
|
package/dist/webpack.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_webpack = require("./webpack-
|
|
2
|
+
const require_webpack = require("./webpack-DJGgU27Y.cjs");
|
|
3
3
|
exports.WeappTailwindcss = require_webpack.WeappTailwindcss;
|
|
4
4
|
exports.weappTailwindcss = require_webpack.WeappTailwindcss;
|
|
5
5
|
exports.weappTailwindcssPackageDir = require_webpack.weappTailwindcssPackageDir;
|
package/dist/webpack.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as weappTailwindcssPackageDir, t as WeappTailwindcss } from "./webpack-
|
|
1
|
+
import { n as weappTailwindcssPackageDir, t as WeappTailwindcss } from "./webpack-Cyvq3H7Z.js";
|
|
2
2
|
export { WeappTailwindcss, WeappTailwindcss as weappTailwindcss, weappTailwindcssPackageDir };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.5.
|
|
4
|
+
"version": "5.5.3",
|
|
5
5
|
"description": "Bring Tailwind CSS to every platform! 把 Tailwind CSS 的原子化开发体验带到全端!",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -204,11 +204,12 @@
|
|
|
204
204
|
"@babel/parser": "^8.0.4",
|
|
205
205
|
"@babel/traverse": "^8.0.4",
|
|
206
206
|
"@babel/types": "^8.0.4",
|
|
207
|
+
"@csstools/css-tokenizer": "^4.0.0",
|
|
207
208
|
"@tailwindcss-mangle/engine": "0.2.0",
|
|
208
209
|
"@vue/compiler-dom": "^3.5.41",
|
|
209
210
|
"@weapp-core/escape": "~8.0.0",
|
|
210
211
|
"@weapp-tailwindcss/logger": "2.0.3",
|
|
211
|
-
"@weapp-tailwindcss/postcss": "3.3.
|
|
212
|
+
"@weapp-tailwindcss/postcss": "3.3.3",
|
|
212
213
|
"@weapp-tailwindcss/reset": "0.1.4",
|
|
213
214
|
"@weapp-tailwindcss/shared": "2.0.3",
|
|
214
215
|
"comment-json": "^5.0.0",
|
|
@@ -220,11 +221,12 @@
|
|
|
220
221
|
"lru-cache": "11.5.2",
|
|
221
222
|
"magic-string": "^1.2.3",
|
|
222
223
|
"micromatch": "^4.0.8",
|
|
223
|
-
"oxc-parser": "^0.
|
|
224
|
+
"oxc-parser": "^0.149.0",
|
|
224
225
|
"oxc-walker": "^1.1.1",
|
|
226
|
+
"postcss-scss": "^4.0.9",
|
|
225
227
|
"semver": "~7.8.5",
|
|
226
228
|
"tailwindcss-config": "2.0.4",
|
|
227
|
-
"weapp-style-injector": "1.0.
|
|
229
|
+
"weapp-style-injector": "1.0.5",
|
|
228
230
|
"yaml": "^2.9.0"
|
|
229
231
|
},
|
|
230
232
|
"devDependencies": {
|
|
@@ -241,7 +243,7 @@
|
|
|
241
243
|
"test": "vitest run",
|
|
242
244
|
"test:dev": "vitest",
|
|
243
245
|
"test:ui": "vitest --ui",
|
|
244
|
-
"bench": "vitest bench --config ./vitest.config.ts",
|
|
246
|
+
"bench": "vitest bench --config ./vitest.config.ts --reporter=default --reporter=json --outputFile.json=benchmark/bench-report.json",
|
|
245
247
|
"bench:core-compiler": "node --expose-gc --import tsx benchmark/core-compiler.ts",
|
|
246
248
|
"bench:vite-perf": "pnpm --filter @weapp-tailwindcss/scripts bench:vite-perf",
|
|
247
249
|
"bench:vite-perf:summary": "pnpm --filter @weapp-tailwindcss/scripts bench:vite-perf:summary",
|