weapp-tailwindcss 5.3.5 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/README.zh-CN.md +4 -4
- package/dist/bundlers/shared/framework-postcss.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/result-helpers.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/source-resolver/single-source.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/types.d.ts +3 -1
- package/dist/bundlers/shared/source-candidates/snapshot.d.ts +19 -0
- package/dist/bundlers/shared/source-candidates/source-priority.d.ts +1 -0
- package/dist/bundlers/shared/source-candidates/types-and-cache.d.ts +1 -0
- package/dist/bundlers/shared/source-candidates/views.d.ts +12 -0
- package/dist/bundlers/shared/style-requests.d.ts +1 -0
- package/dist/bundlers/vite/bundle-state.d.ts +9 -1
- package/dist/bundlers/vite/capability-profile.d.ts +18 -0
- package/dist/bundlers/vite/generate-bundle/js-processing.d.ts +12 -0
- package/dist/bundlers/vite/hot-css-modules.d.ts +2 -2
- package/dist/bundlers/vite/shared/configured-css-entry-observer.d.ts +29 -0
- package/dist/bundlers/vite/shared/create-framework-plugins.d.ts +8 -0
- package/dist/bundlers/vite/shared/framework-css-generation-queue.d.ts +1 -0
- package/dist/bundlers/vite/shared/framework-hmr-module-version.d.ts +9 -0
- package/dist/bundlers/vite/shared/framework-runtime-utils.d.ts +5 -0
- package/dist/bundlers/vite/shared/framework-source-scan-session.d.ts +12 -2
- package/dist/compiler/compilation-session-pool.d.ts +1 -0
- package/dist/compiler/framework-compiler-session.d.ts +21 -0
- package/dist/compiler/index.d.ts +1 -0
- package/dist/{context-DTLRADfE.cjs → compiler-C93NfxSe.cjs} +859 -11
- package/dist/{context-4ittVpgt.js → compiler-qDa3phIv.js} +764 -5
- package/dist/context/handlers.d.ts +1 -1
- package/dist/core/compiler/compiler.d.ts +2 -0
- package/dist/core/compiler/generation-cache.d.ts +30 -0
- package/dist/core/compiler/generation-state.d.ts +17 -0
- package/dist/core/compiler/index.d.ts +2 -0
- package/dist/core/compiler/root-store.d.ts +38 -0
- package/dist/core/compiler/snapshot.d.ts +35 -0
- package/dist/core/compiler/source-fingerprint.d.ts +3 -0
- package/dist/core/compiler/transforms.d.ts +15 -0
- package/dist/core/compiler/types.d.ts +69 -0
- package/dist/core.cjs +9 -8
- package/dist/core.d.ts +2 -1
- package/dist/core.js +2 -2
- package/dist/framework/index.d.ts +3 -1
- package/dist/framework.cjs +6 -1
- package/dist/framework.js +6 -1
- package/dist/{generator-EnTXLBlK.js → generator-C0m2S4WI.js} +3 -2
- package/dist/{generator-DKiYbTFR.cjs → generator-CKJ6sj1f.cjs} +3 -2
- package/dist/generator.cjs +1 -1
- package/dist/generator.js +1 -1
- package/dist/{gulp-CUysZjW3.cjs → gulp-CW6JGqVn.cjs} +14 -16
- package/dist/{gulp-DwtrU4V1.js → gulp-e2iWsmEK.js} +7 -7
- package/dist/gulp.cjs +1 -1
- package/dist/gulp.js +1 -1
- package/dist/{hmr-timing-utmOgn6p.js → hmr-timing-DgMgwSce.js} +367 -289
- package/dist/{hmr-timing-Cvh5UgnM.cjs → hmr-timing-n7QQKFp7.cjs} +4 -4
- package/dist/index.cjs +4 -4
- package/dist/index.js +4 -4
- package/dist/{pipeline-helpers-CyVXL3h6.cjs → pipeline-helpers-DoLQy44Q.cjs} +6 -6
- package/dist/postcss.cjs +1 -1
- package/dist/postcss.js +1 -1
- package/dist/presets.cjs +2 -3
- package/dist/presets.js +1 -1
- package/dist/rspack.cjs +2 -2
- package/dist/rspack.js +2 -2
- package/dist/{source-candidate-scan-signature-CDrLxVKu.js → source-candidate-scan-signature-B0lOMiwB.js} +3 -3
- package/dist/{source-candidate-scan-signature-BNt7NrrI.cjs → source-candidate-scan-signature-Chb-Zrwt.cjs} +5 -5
- package/dist/{tailwindcss-CexDJBhx.cjs → tailwindcss-BGlJ1m1l.cjs} +763 -5
- package/dist/{tailwindcss-ChnpCv25.js → tailwindcss-BSKl0FTD.js} +1 -1
- package/dist/{transform-AfnwH_yx.cjs → transform-C6k9zTQR.cjs} +16 -7
- package/dist/{transform-BMPNt_vj.js → transform-DQhgAarN.js} +16 -7
- package/dist/typedoc.export.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/uni-app-x/component-local-style.d.ts +2 -0
- package/dist/uni-app-x/transform.d.ts +1 -0
- package/dist/uni-app-x/vite/asset-task.d.ts +21 -0
- package/dist/uni-app-x/vite/plugin-options.d.ts +8 -0
- package/dist/uni-app-x/vite/web-local-style.d.ts +2 -1
- package/dist/uni-app-x/vite.d.ts +1 -21
- package/dist/{v4-generation-core-Dhsu9Deu.cjs → v4-generation-core-B2sUkkgq.cjs} +378 -300
- package/dist/{vite-qxEVovZD.cjs → vite-B0IPgrvM.cjs} +807 -200
- package/dist/{vite-mWyHvLB0.js → vite-CcEb2SOl.js} +774 -165
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/dist/weapp-tw-css-generation-loader.cjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +7 -7
- package/dist/{webpack-Cpy_yggg.cjs → webpack-B5vc13U_.cjs} +33 -35
- package/dist/{webpack-CzhrD9p3.js → webpack-BPA5I79o.js} +7 -7
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.js +1 -1
- package/dist/wxml/utils.d.ts +1 -1
- package/dist/{wxml-B7OAVpXJ.js → wxml-CvKyV69S.js} +10 -2
- package/dist/{wxml-PrK-8ARX.cjs → wxml-o-CUulAM.cjs} +40 -32
- package/package.json +12 -11
- package/dist/options-BJrtIQbH.cjs +0 -768
- package/dist/style-options-DW30H5PV.cjs +0 -82
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-B0IPgrvM.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-CcEb2SOl.js";
|
|
2
2
|
export { WeappTailwindcss, WeappTailwindcss as weappTailwindcss };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_generator = require("./generator-
|
|
1
|
+
const require_generator = require("./generator-CKJ6sj1f.cjs");
|
|
2
2
|
const require_weapp_tw_css_import_rewrite_loader = require("./weapp-tw-css-import-rewrite-loader.cjs");
|
|
3
3
|
let node_buffer = require("node:buffer");
|
|
4
4
|
//#region src/bundlers/webpack/loaders/weapp-tw-css-generation-loader.ts
|
|
@@ -3,12 +3,12 @@ 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
|
|
8
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
9
|
-
const
|
|
6
|
+
const require_generator = require("./generator-CKJ6sj1f.cjs");
|
|
7
|
+
const require_tailwindcss = require("./tailwindcss-BGlJ1m1l.cjs");
|
|
8
|
+
const require_v4_generation_core = require("./v4-generation-core-B2sUkkgq.cjs");
|
|
9
|
+
const require_compiler = require("./compiler-C93NfxSe.cjs");
|
|
10
10
|
const require_css_imports = require("./css-imports-BFMU7Hpd.cjs");
|
|
11
|
-
const require_pipeline_helpers = require("./pipeline-helpers-
|
|
11
|
+
const require_pipeline_helpers = require("./pipeline-helpers-DoLQy44Q.cjs");
|
|
12
12
|
const require_runtime_registry = require("./runtime-registry-BlIjpImP.cjs");
|
|
13
13
|
const require_watch_dependencies = require("./watch-dependencies-DLZDrWdH.cjs");
|
|
14
14
|
let node_path = require("node:path");
|
|
@@ -60,7 +60,7 @@ function createCssHandlerOptions(options, majorVersion, file, appType) {
|
|
|
60
60
|
return {
|
|
61
61
|
isMainChunk: matchedCssEntryIndex >= 0 ? matchedCssEntryIndex === 0 : options.mainCssChunkMatcher(file, appType),
|
|
62
62
|
postcssOptions: { options: { from: file } },
|
|
63
|
-
...
|
|
63
|
+
...require_compiler.normalizeStyleHandlerMajorVersion(majorVersion) === void 0 ? {} : { majorVersion: 4 }
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
async function resolveWebpackLoaderSourceCandidates(source, loaderContext, options) {
|
|
@@ -68,7 +68,7 @@ async function resolveWebpackLoaderSourceCandidates(source, loaderContext, optio
|
|
|
68
68
|
if (!compilerOptions) return;
|
|
69
69
|
const root = compilerOptions.tailwindcssBasedir ?? node_process.default.cwd();
|
|
70
70
|
const file = loaderContext.resourcePath;
|
|
71
|
-
const resolved = await
|
|
71
|
+
const resolved = await require_tailwindcss.resolveTailwindV4EntriesFromCssCached(source, node_path.default.dirname(file));
|
|
72
72
|
if (!resolved) return;
|
|
73
73
|
const collector = require_v4_generation_core.createSourceCandidateStore({
|
|
74
74
|
bareArbitraryValues: compilerOptions.arbitraryValues?.bareArbitraryValues,
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
2
|
-
const require_generator = require("./generator-
|
|
2
|
+
const require_generator = require("./generator-CKJ6sj1f.cjs");
|
|
3
3
|
const require_object = require("./object-DbHtAXRk.cjs");
|
|
4
|
-
const
|
|
4
|
+
const require_tailwindcss = require("./tailwindcss-BGlJ1m1l.cjs");
|
|
5
5
|
const require_utils = require("./utils-CuKLf1Zv.cjs");
|
|
6
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
7
|
-
const require_wxml = require("./wxml-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-BNt7NrrI.cjs");
|
|
13
|
-
const require_pipeline_helpers = require("./pipeline-helpers-CyVXL3h6.cjs");
|
|
6
|
+
const require_v4_generation_core = require("./v4-generation-core-B2sUkkgq.cjs");
|
|
7
|
+
const require_wxml = require("./wxml-o-CUulAM.cjs");
|
|
8
|
+
const require_compiler = require("./compiler-C93NfxSe.cjs");
|
|
9
|
+
const require_hmr_timing = require("./hmr-timing-n7QQKFp7.cjs");
|
|
10
|
+
const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-Chb-Zrwt.cjs");
|
|
11
|
+
const require_pipeline_helpers = require("./pipeline-helpers-DoLQy44Q.cjs");
|
|
14
12
|
const require_css_loader_runtime = require("./css-loader-runtime-CSv0lKqV.cjs");
|
|
15
13
|
const require_runtime_registry = require("./runtime-registry-BlIjpImP.cjs");
|
|
16
14
|
let node_fs = require("node:fs");
|
|
@@ -438,7 +436,7 @@ function createWebpackCssSourceResolvers(options) {
|
|
|
438
436
|
...generatorSourceCss === void 0 ? {} : { sourceCss: generatorSourceCss },
|
|
439
437
|
...sourceFile === void 0 ? {} : { sourceFile }
|
|
440
438
|
},
|
|
441
|
-
...
|
|
439
|
+
...require_compiler.normalizeStyleHandlerMajorVersion(majorVersion) === void 0 ? {} : { majorVersion: 4 }
|
|
442
440
|
};
|
|
443
441
|
cssHandlerOptionsCache.set(cacheKey, created);
|
|
444
442
|
return created;
|
|
@@ -627,7 +625,7 @@ async function processWebpackGeneratedCssAsset(element, context) {
|
|
|
627
625
|
const shouldPreserveExistingPreflight = cssHandlerOptions.isMainChunk || !isConfiguredMainCssSource && (isConfiguredCssSource || sourceCssHasTailwindRoot);
|
|
628
626
|
const loaderGeneratedCss = sourceFile ? generatedCssSources.get(node_path.default.resolve(sourceFile)) : void 0;
|
|
629
627
|
const shouldRegenerateExplicitTailwindV4CssSource = sourceCss !== void 0 && (require_generator.hasTailwindSourceDirectives(sourceCss, { importFallback: true }) || sourceCss.includes("@config"));
|
|
630
|
-
const explicitTailwindV4SourceCandidates = shouldRegenerateExplicitTailwindV4CssSource && sourceCss && sourceFile && webpackSourceCandidates?.getSourceCandidatesForEntries ? await
|
|
628
|
+
const explicitTailwindV4SourceCandidates = shouldRegenerateExplicitTailwindV4CssSource && sourceCss && sourceFile && webpackSourceCandidates?.getSourceCandidatesForEntries ? await require_tailwindcss.resolveTailwindV4EntriesFromCssCached(sourceCss, node_path.default.dirname(sourceFile)).then((resolved) => resolved?.entries ? webpackSourceCandidates.getSourceCandidatesForEntries(resolved.entries) : void 0) : void 0;
|
|
631
629
|
if (loaderGeneratedCss && require_pipeline_helpers.shouldConsumeWebpackLoaderGeneratedCss({
|
|
632
630
|
allowMarkerlessRegistryMatch: configuredCssEntryFiles.length === 1,
|
|
633
631
|
hasBundlerGeneratedCssMarker: require_v4_generation_core.hasBundlerGeneratedCssMarker(currentRawSource),
|
|
@@ -985,7 +983,7 @@ async function enqueueWebpackHtmlAndJsTasks(context) {
|
|
|
985
983
|
moduleGraph: outputModuleGraphOptions,
|
|
986
984
|
babelParserOptions: { sourceFilename: absoluteFile }
|
|
987
985
|
};
|
|
988
|
-
if (
|
|
986
|
+
if (require_compiler.shouldSkipJsTransform(currentSource, {
|
|
989
987
|
...handlerOptions,
|
|
990
988
|
classNameSet: transformRuntimeSet
|
|
991
989
|
})) return { result: new ConcatSource(currentSource) };
|
|
@@ -1385,7 +1383,7 @@ async function refreshWebpackSourceCandidates(options) {
|
|
|
1385
1383
|
const root = options.compilerOptions.tailwindcssBasedir ?? node_process.default.cwd();
|
|
1386
1384
|
let sourceScan;
|
|
1387
1385
|
try {
|
|
1388
|
-
sourceScan = await
|
|
1386
|
+
sourceScan = await require_tailwindcss.resolveSourceScanEntries(options.compilerOptions, options.runtimeState.tailwindRuntime, {
|
|
1389
1387
|
root,
|
|
1390
1388
|
outDir: options.outputDir
|
|
1391
1389
|
});
|
|
@@ -1426,9 +1424,9 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
1426
1424
|
const bundleRuntimeClassSetManager = runtimeClassSetManager ?? require_hmr_timing.createRuntimeClassSetManager();
|
|
1427
1425
|
const escapeFragments = require_v4_generation_core.createEscapeFragments(_weapp_core_escape.MappingChars2String);
|
|
1428
1426
|
const processedCssAssetSkipDecisionCache = /* @__PURE__ */ new Map();
|
|
1429
|
-
compiler.hooks.compilation.tap(
|
|
1427
|
+
compiler.hooks.compilation.tap(require_compiler.pluginName, (compilation) => {
|
|
1430
1428
|
compilation.hooks.processAssets.tapPromise({
|
|
1431
|
-
name:
|
|
1429
|
+
name: require_compiler.pluginName,
|
|
1432
1430
|
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
1433
1431
|
}, async (assets) => {
|
|
1434
1432
|
const entries = Object.entries(assets);
|
|
@@ -1559,7 +1557,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
1559
1557
|
await bundleRuntimeClassSetManager.reset();
|
|
1560
1558
|
require_hmr_timing.resetRuntimeCompilationBuildState(bundleBuildState);
|
|
1561
1559
|
}
|
|
1562
|
-
runtimeSet = await
|
|
1560
|
+
runtimeSet = await require_compiler.ensureRuntimeClassSet(runtimeState, {
|
|
1563
1561
|
forceRefresh: forceRuntimeRefresh,
|
|
1564
1562
|
forceCollect: !watchMode || forceRuntimeRefresh,
|
|
1565
1563
|
clearCache: forceRuntimeRefresh,
|
|
@@ -1731,7 +1729,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
1731
1729
|
require_hmr_timing.finalizeCompilerShadowRun(runtimeState);
|
|
1732
1730
|
});
|
|
1733
1731
|
if (!isWebGeneratorTarget) compilation.hooks.processAssets.tapPromise({
|
|
1734
|
-
name: `${
|
|
1732
|
+
name: `${require_compiler.pluginName}:finalize-css-assets`,
|
|
1735
1733
|
stage: Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_HASH
|
|
1736
1734
|
}, async (assets) => {
|
|
1737
1735
|
const entries = Object.entries(assets);
|
|
@@ -2185,8 +2183,8 @@ function setupWebpackV5Loaders(options) {
|
|
|
2185
2183
|
require_runtime_registry.deleteWebpackLoaderRuntime(runtimeRegistryKey);
|
|
2186
2184
|
require_v4_generation_core.disposeCompilerOwner(runtimeState);
|
|
2187
2185
|
};
|
|
2188
|
-
compiler.hooks.watchClose?.tap?.(
|
|
2189
|
-
compiler.hooks.shutdown?.tap?.(
|
|
2186
|
+
compiler.hooks.watchClose?.tap?.(require_compiler.pluginName, cleanupWebpackLoaderRuntime);
|
|
2187
|
+
compiler.hooks.shutdown?.tap?.(require_compiler.pluginName, cleanupWebpackLoaderRuntime);
|
|
2190
2188
|
const { findRewriteAnchor, findClassSetAnchor } = loaderAnchorFinders;
|
|
2191
2189
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions && shouldInjectCssImportRewriteLoader ? {
|
|
2192
2190
|
generateCss: compilerOptions.platform === "lynx",
|
|
@@ -2219,9 +2217,9 @@ function setupWebpackV5Loaders(options) {
|
|
|
2219
2217
|
};
|
|
2220
2218
|
};
|
|
2221
2219
|
const { NormalModule } = compiler.webpack;
|
|
2222
|
-
compiler.hooks.compilation.tap(
|
|
2220
|
+
compiler.hooks.compilation.tap(require_compiler.pluginName, (compilation) => {
|
|
2223
2221
|
NormalModule.getCompilationHooks(compilation).loader.tap({
|
|
2224
|
-
name:
|
|
2222
|
+
name: require_compiler.pluginName,
|
|
2225
2223
|
stage: 100
|
|
2226
2224
|
}, (_loaderContext, module) => {
|
|
2227
2225
|
if (!(runtimeClassSetLoaderExists || runtimeCssGenerationLoaderExists || runtimeCssImportRewriteLoaderExists)) return;
|
|
@@ -2339,8 +2337,8 @@ function setupWebpackWatchOutputIgnore(compiler) {
|
|
|
2339
2337
|
const watchOptions = compiler.watching?.watchOptions;
|
|
2340
2338
|
if (watchOptions) appendOutputIgnoredPath(watchOptions, outputPath);
|
|
2341
2339
|
};
|
|
2342
|
-
compiler.hooks.watchRun?.tap(
|
|
2343
|
-
compiler.hooks.thisCompilation?.tap(
|
|
2340
|
+
compiler.hooks.watchRun?.tap(require_compiler.pluginName, syncOutputIgnoredPath);
|
|
2341
|
+
compiler.hooks.thisCompilation?.tap(require_compiler.pluginName, (compilation) => {
|
|
2344
2342
|
const outputPath = compilation.compiler?.outputPath || compilation.outputOptions?.path;
|
|
2345
2343
|
const watchOptions = compiler.watching?.watchOptions;
|
|
2346
2344
|
if (watchOptions) appendOutputIgnoredPath(watchOptions, outputPath);
|
|
@@ -2363,7 +2361,7 @@ var WebpackFrameworkPlugin = class {
|
|
|
2363
2361
|
require_object._defineProperty(this, "frameworkBranch", void 0);
|
|
2364
2362
|
this.frameworkBranch = frameworkBranch;
|
|
2365
2363
|
this.hasInitialTailwindCssRoots = require_generator.hasConfiguredTailwindV4CssRoots(options);
|
|
2366
|
-
this.options = isInternalUserDefinedOptions(options) ? options :
|
|
2364
|
+
this.options = isInternalUserDefinedOptions(options) ? options : require_compiler.getCompilerContext({
|
|
2367
2365
|
...options,
|
|
2368
2366
|
__internalDeferMissingCssEntriesWarning: true
|
|
2369
2367
|
});
|
|
@@ -2391,7 +2389,7 @@ var WebpackFrameworkPlugin = class {
|
|
|
2391
2389
|
setupWebpackWatchOutputIgnore(compiler);
|
|
2392
2390
|
const runtimeState = {
|
|
2393
2391
|
tailwindRuntime: initialTailwindRuntime,
|
|
2394
|
-
readyPromise:
|
|
2392
|
+
readyPromise: require_compiler.createTailwindRuntimeReadyPromise(initialTailwindRuntime),
|
|
2395
2393
|
refreshTailwindcssRuntime: refreshTailwindRuntime
|
|
2396
2394
|
};
|
|
2397
2395
|
let runtimeSetPrepared = false;
|
|
@@ -2463,7 +2461,7 @@ var WebpackFrameworkPlugin = class {
|
|
|
2463
2461
|
runtimeSetPrepared = false;
|
|
2464
2462
|
runtimeMetadataPrepared = false;
|
|
2465
2463
|
runtimeRefreshRequiredForCompilation = true;
|
|
2466
|
-
await
|
|
2464
|
+
await require_compiler.refreshTailwindRuntimeState(runtimeState, {
|
|
2467
2465
|
force: true,
|
|
2468
2466
|
clearCache: true
|
|
2469
2467
|
});
|
|
@@ -2540,20 +2538,20 @@ var WebpackFrameworkPlugin = class {
|
|
|
2540
2538
|
for (const source of tailwindOptions?.v4?.cssSources ?? []) if (source.file && webpackProcessedCssSourceFiles.has(node_path.default.resolve(source.file))) return true;
|
|
2541
2539
|
return false;
|
|
2542
2540
|
};
|
|
2543
|
-
compiler.hooks.invalid?.tap?.(
|
|
2541
|
+
compiler.hooks.invalid?.tap?.(require_compiler.pluginName, (fileName) => {
|
|
2544
2542
|
if (!fileName) return;
|
|
2545
2543
|
runtimeRefreshRequiredForCompilation = runtimeRefreshRequiredForCompilation || hasRuntimeDependencyChanges([node_path.default.resolve(fileName)]);
|
|
2546
2544
|
});
|
|
2547
|
-
compiler.hooks.watchRun?.tap?.(
|
|
2548
|
-
if (compiler.hooks.thisCompilation?.tap) compiler.hooks.thisCompilation.tap(
|
|
2549
|
-
else if (compiler.hooks.compilation?.tap) compiler.hooks.compilation.tap(
|
|
2545
|
+
compiler.hooks.watchRun?.tap?.(require_compiler.pluginName, () => syncRuntimeRefreshRequirement(true));
|
|
2546
|
+
if (compiler.hooks.thisCompilation?.tap) compiler.hooks.thisCompilation.tap(require_compiler.pluginName, resetRuntimePreparation);
|
|
2547
|
+
else if (compiler.hooks.compilation?.tap) compiler.hooks.compilation.tap(require_compiler.pluginName, resetRuntimePreparation);
|
|
2550
2548
|
async function getClassSetInLoader() {
|
|
2551
2549
|
if (runtimeSetPrepared) return;
|
|
2552
2550
|
const signature = require_tailwindcss.getRuntimeClassSetSignature(runtimeState.tailwindRuntime);
|
|
2553
2551
|
const forceRefresh = runtimeRefreshRequiredForCompilation || signature !== runtimeSetSignature;
|
|
2554
2552
|
debug("runtime loader ensure class set forceRefresh=%s watchDirty=%s signatureChanged=%s", forceRefresh, runtimeRefreshRequiredForCompilation, signature !== runtimeSetSignature);
|
|
2555
2553
|
runtimeSetPrepared = true;
|
|
2556
|
-
await
|
|
2554
|
+
await require_compiler.ensureRuntimeClassSet(runtimeState, {
|
|
2557
2555
|
forceRefresh,
|
|
2558
2556
|
forceCollect: forceRefresh || !watchRunObserved,
|
|
2559
2557
|
clearCache: forceRefresh,
|
|
@@ -2565,7 +2563,7 @@ var WebpackFrameworkPlugin = class {
|
|
|
2565
2563
|
}
|
|
2566
2564
|
async function getRuntimeSetInLoader() {
|
|
2567
2565
|
await getClassSetInLoader();
|
|
2568
|
-
return
|
|
2566
|
+
return require_compiler.ensureRuntimeClassSet(runtimeState, { allowEmpty: true });
|
|
2569
2567
|
}
|
|
2570
2568
|
onLoad();
|
|
2571
2569
|
setupWebpackV5Loaders({
|
|
@@ -2695,13 +2693,13 @@ function createWebpackFrameworkPlugin(frameworkName, options = {}) {
|
|
|
2695
2693
|
/**
|
|
2696
2694
|
* @name WeappTailwindcss
|
|
2697
2695
|
* @description Webpack 入口只负责早期识别框架分支,具体 hook 由 framework 目录下的插件拥有。
|
|
2698
|
-
* @link https://tw.
|
|
2696
|
+
* @link https://tw.weapp.dev/docs/intro
|
|
2699
2697
|
*/
|
|
2700
2698
|
var WeappTailwindcss = class {
|
|
2701
2699
|
constructor(options = {}) {
|
|
2702
2700
|
require_object._defineProperty(this, "options", void 0);
|
|
2703
2701
|
require_object._defineProperty(this, "appType", void 0);
|
|
2704
|
-
this.options =
|
|
2702
|
+
this.options = require_compiler.getCompilerContext({
|
|
2705
2703
|
...options,
|
|
2706
2704
|
__internalDeferMissingCssEntriesWarning: true
|
|
2707
2705
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { $ as hasTailwindSourceDirectives, B as stripMiniProgramCssSpecificityPlaceholders, D as resolveTailwindcssOptions, F as stripUnmatchedTailwindSourceMediaCloseFragments, I as finalizeMiniProgramCss, M as removeMiniProgramInteractiveSelectors, N as removeTailwindV4GeneratorAtRules, Ot as resolveSourceScanPath, P as stripTailwindSourceMediaFragments, Pt as getTailwindV4IncrementalGenerateCacheStats, Q as hasTailwindRootDirectives, R as pruneMiniProgramGeneratedCss, V as removeTailwindV4GeneratedUserCssArtifacts, X as hasTailwindApplyDirective, _ as upsertTailwindV4CssSource, et as normalizeTailwindConfigDirectives, h as hasConfiguredTailwindV4CssRoots, i as normalizeWeappTailwindcssGeneratorOptions, it as removeTailwindSourceDirectives, j as isCommentOnlyCss, lt as hasTailwindGeneratedCss, o as resolveRuntimeBranch, rt as parseImportRequest, ut as hasTailwindGeneratedCssMarkers } from "./generator-
|
|
1
|
+
import { $ as hasTailwindSourceDirectives, B as stripMiniProgramCssSpecificityPlaceholders, D as resolveTailwindcssOptions, F as stripUnmatchedTailwindSourceMediaCloseFragments, I as finalizeMiniProgramCss, M as removeMiniProgramInteractiveSelectors, N as removeTailwindV4GeneratorAtRules, Ot as resolveSourceScanPath, P as stripTailwindSourceMediaFragments, Pt as getTailwindV4IncrementalGenerateCacheStats, Q as hasTailwindRootDirectives, R as pruneMiniProgramGeneratedCss, V as removeTailwindV4GeneratedUserCssArtifacts, X as hasTailwindApplyDirective, _ as upsertTailwindV4CssSource, et as normalizeTailwindConfigDirectives, h as hasConfiguredTailwindV4CssRoots, i as normalizeWeappTailwindcssGeneratorOptions, it as removeTailwindSourceDirectives, j as isCommentOnlyCss, lt as hasTailwindGeneratedCss, o as resolveRuntimeBranch, rt as parseImportRequest, ut as hasTailwindGeneratedCssMarkers } from "./generator-C0m2S4WI.js";
|
|
2
2
|
import { n as _defineProperty } from "./object-B-8IHefx.js";
|
|
3
|
-
import { f as resolveSourceScanEntries, g as resolveTailwindV4EntriesFromCssCached, l as getRuntimeClassSetSignature } from "./tailwindcss-
|
|
3
|
+
import { f as resolveSourceScanEntries, g as resolveTailwindV4EntriesFromCssCached, l as getRuntimeClassSetSignature } from "./tailwindcss-BSKl0FTD.js";
|
|
4
4
|
import { r as getGroupedEntries } from "./utils-MVwpU07P.js";
|
|
5
|
-
import { $ as AssetEmissionPlan, C as isSourceStyleRequest, E as hasBundlerGeneratedCssMarker, F as processCachedTask, G as createRuntimeCompilationBuildState, H as finalizeCompilerShadowRun, I as createRuntimeClassSetManager, J as updateRuntimeCompilationBuildState, L as collectStrictEscapedRuntimeCandidates, M as createCssSourceTraceCacheSignature, N as createCssTokenSourceMap, O as stripBundlerGeneratedCssMarkers, P as isCssSourceTraceEnabled, R as createEscapeFragments, U as buildRuntimeCompilationSnapshot, W as createRuntimeCompilationAffectingSignature, X as disposeCompilerOwner, Y as createRuntimeAffectingSourceSignature, Z as beginCompilerShadowRun, _ as captureResolvedFrameworkPostcssOptions, at as createSourceCandidateStore, c as collectRawSourceClassSelectors, et as getCompilationScopeDependencyRevision, h as removeGeneratedSelectorCompatCss, j as annotateCssSourceTrace, k as finalizeMiniProgramCssStructure, l as pushConcurrentTaskFactories, lt as resolveSourceCandidateScanFiles, m as scoreTailwindV4CssSourceFileMatch, n as emitHmrTiming, nt as recordCompilationDependencyChanges, ot as isSourceCandidateRequest, q as resetRuntimeCompilationBuildState, r as generateTailwindV4Css, rt as createCompilationDependencyChanges, u as resolveTaskConcurrency, v as collectFrameworkPostcssOptionsFromLoaderEntries, w as stripRequestQuery, x as hasMiniProgramTailwindV4PreflightReset, y as createCssSourceOrderAppend, z as isPureLocalCssImportWrapper } from "./hmr-timing-
|
|
6
|
-
import { _ as md5Hash, m as createDebug } from "./wxml-
|
|
7
|
-
import {
|
|
5
|
+
import { $ as AssetEmissionPlan, C as isSourceStyleRequest, E as hasBundlerGeneratedCssMarker, F as processCachedTask, G as createRuntimeCompilationBuildState, H as finalizeCompilerShadowRun, I as createRuntimeClassSetManager, J as updateRuntimeCompilationBuildState, L as collectStrictEscapedRuntimeCandidates, M as createCssSourceTraceCacheSignature, N as createCssTokenSourceMap, O as stripBundlerGeneratedCssMarkers, P as isCssSourceTraceEnabled, R as createEscapeFragments, U as buildRuntimeCompilationSnapshot, W as createRuntimeCompilationAffectingSignature, X as disposeCompilerOwner, Y as createRuntimeAffectingSourceSignature, Z as beginCompilerShadowRun, _ as captureResolvedFrameworkPostcssOptions, at as createSourceCandidateStore, c as collectRawSourceClassSelectors, et as getCompilationScopeDependencyRevision, h as removeGeneratedSelectorCompatCss, j as annotateCssSourceTrace, k as finalizeMiniProgramCssStructure, l as pushConcurrentTaskFactories, lt as resolveSourceCandidateScanFiles, m as scoreTailwindV4CssSourceFileMatch, n as emitHmrTiming, nt as recordCompilationDependencyChanges, ot as isSourceCandidateRequest, q as resetRuntimeCompilationBuildState, r as generateTailwindV4Css, rt as createCompilationDependencyChanges, u as resolveTaskConcurrency, v as collectFrameworkPostcssOptionsFromLoaderEntries, w as stripRequestQuery, x as hasMiniProgramTailwindV4PreflightReset, y as createCssSourceOrderAppend, z as isPureLocalCssImportWrapper } from "./hmr-timing-DgMgwSce.js";
|
|
6
|
+
import { _ as md5Hash, m as createDebug } from "./wxml-CvKyV69S.js";
|
|
7
|
+
import { a as pluginName, d as ensureRuntimeClassSet, f as refreshTailwindRuntimeState, i as resolveStyleOptionsFromContext, n as getCompilerContext, r as normalizeStyleHandlerMajorVersion, s as shouldSkipJsTransform, u as createTailwindRuntimeReadyPromise } from "./compiler-qDa3phIv.js";
|
|
8
8
|
import { getDefaultCssPreflight } from "./defaults.js";
|
|
9
|
-
import { S as resolveWebpackFrameworkProfile, a as createCandidateSignature, b as webpackStyleInjectorDelegates, d as classifyRuntimeEntry, f as resolvePackageDir, g as toAbsoluteOutputPath, h as resolveOutputSpecifier, p as resolvePluginDisabledState, r as createScopedGeneratorRuntime, t as createSourceCandidateScanSignature, v as createBuiltinWebpackStyleInjectorPlugin } from "./source-candidate-scan-signature-
|
|
9
|
+
import { S as resolveWebpackFrameworkProfile, a as createCandidateSignature, b as webpackStyleInjectorDelegates, d as classifyRuntimeEntry, f as resolvePackageDir, g as toAbsoluteOutputPath, h as resolveOutputSpecifier, p as resolvePluginDisabledState, r as createScopedGeneratorRuntime, t as createSourceCandidateScanSignature, v as createBuiltinWebpackStyleInjectorPlugin } from "./source-candidate-scan-signature-B0lOMiwB.js";
|
|
10
10
|
import Module, { createRequire } from "node:module";
|
|
11
11
|
import fs from "node:fs";
|
|
12
12
|
import path from "node:path";
|
|
@@ -3453,7 +3453,7 @@ function createWebpackFrameworkPlugin(frameworkName, options = {}) {
|
|
|
3453
3453
|
/**
|
|
3454
3454
|
* @name WeappTailwindcss
|
|
3455
3455
|
* @description Webpack 入口只负责早期识别框架分支,具体 hook 由 framework 目录下的插件拥有。
|
|
3456
|
-
* @link https://tw.
|
|
3456
|
+
* @link https://tw.weapp.dev/docs/intro
|
|
3457
3457
|
*/
|
|
3458
3458
|
var WeappTailwindcss = class {
|
|
3459
3459
|
constructor(options = {}) {
|
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-B5vc13U_.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-BPA5I79o.js";
|
|
2
2
|
export { WeappTailwindcss, WeappTailwindcss as weappTailwindcss, weappTailwindcssPackageDir };
|
package/dist/wxml/utils.d.ts
CHANGED
|
@@ -5,4 +5,4 @@ import { customTemplateHandler } from './utils/custom-template.js';
|
|
|
5
5
|
import { templateReplacer } from './utils/template-fragments.js';
|
|
6
6
|
export { isPropsMatch };
|
|
7
7
|
export { customTemplateHandler, generateCode, templateReplacer };
|
|
8
|
-
export declare function createTemplateHandler(options?: Omit<ITemplateHandlerOptions, 'runtimeSet'>): (rawSource: string, opt?:
|
|
8
|
+
export declare function createTemplateHandler(options?: Omit<ITemplateHandlerOptions, 'runtimeSet'>): (rawSource: string, opt?: ITemplateHandlerOptions) => Promise<string>;
|
|
@@ -2,6 +2,7 @@ import { n as _defineProperty, t as omitUndefined } from "./object-B-8IHefx.js";
|
|
|
2
2
|
import { n as HARD_PARSE_CACHE_MAX_ENTRIES, t as DEFAULT_PARSE_CACHE_MAX_SOURCE_LENGTH } from "./cache-options-DwBtLwQe.js";
|
|
3
3
|
import { splitCandidateTokens } from "@tailwindcss-mangle/engine";
|
|
4
4
|
import { LRUCache } from "lru-cache";
|
|
5
|
+
import { defuOverrideArray } from "@weapp-tailwindcss/shared";
|
|
5
6
|
import { md5 as md5Hash } from "@weapp-tailwindcss/shared/node";
|
|
6
7
|
import { Parser } from "htmlparser2";
|
|
7
8
|
import _babelTraverse from "@babel/traverse";
|
|
@@ -1680,11 +1681,17 @@ function updateWhitespaceGap(ms, start, end, options) {
|
|
|
1680
1681
|
}));
|
|
1681
1682
|
}
|
|
1682
1683
|
function updateWxmlSegment(ms, start, end, options, keepEOL, ignoreHead) {
|
|
1683
|
-
|
|
1684
|
+
const value = ms.slice(start, end);
|
|
1685
|
+
const replaceOptions = {
|
|
1684
1686
|
keepEOL,
|
|
1685
1687
|
escapeMap: options.escapeMap,
|
|
1686
1688
|
ignoreHead
|
|
1687
|
-
}
|
|
1689
|
+
};
|
|
1690
|
+
if (options.classSetMode === "exact" && options.runtimeSet) {
|
|
1691
|
+
ms.update(start, end, value.replace(/\S+/g, (candidate) => options.runtimeSet.has(candidate) ? replaceWxml(candidate, replaceOptions) : candidate));
|
|
1692
|
+
return;
|
|
1693
|
+
}
|
|
1694
|
+
ms.update(start, end, replaceWxml(value, replaceOptions));
|
|
1688
1695
|
}
|
|
1689
1696
|
function updateExpressionSegment(ms, exp, options) {
|
|
1690
1697
|
const code = `{{${generateCode(exp.value.slice(2, -2), options)}}}`;
|
|
@@ -1799,6 +1806,7 @@ function createTemplateHandler(options = {}) {
|
|
|
1799
1806
|
let cachedOptionsWithRuntimeSet;
|
|
1800
1807
|
return (rawSource, opt) => {
|
|
1801
1808
|
const runtimeSet = opt?.runtimeSet;
|
|
1809
|
+
if (opt && Object.keys(opt).some((key) => key !== "runtimeSet")) return customTemplateHandler(rawSource, defuOverrideArray(opt, defaultOptions), opt.customAttributesEntities === void 0 ? cachedMatcher : void 0);
|
|
1802
1810
|
if (runtimeSet === void 0) return customTemplateHandler(rawSource, defaultOptions, cachedMatcher);
|
|
1803
1811
|
if (cachedRuntimeSet !== runtimeSet || !cachedOptionsWithRuntimeSet) {
|
|
1804
1812
|
cachedRuntimeSet = runtimeSet;
|
|
@@ -3,6 +3,7 @@ const require_object = require("./object-DbHtAXRk.cjs");
|
|
|
3
3
|
const require_cache_options = require("./cache-options-DavPxrhC.cjs");
|
|
4
4
|
let _tailwindcss_mangle_engine = require("@tailwindcss-mangle/engine");
|
|
5
5
|
let lru_cache = require("lru-cache");
|
|
6
|
+
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
6
7
|
let _weapp_tailwindcss_shared_node = require("@weapp-tailwindcss/shared/node");
|
|
7
8
|
let node_tty = require("node:tty");
|
|
8
9
|
let node_util = require("node:util");
|
|
@@ -35772,7 +35773,7 @@ function babelParse(code, opts = {}) {
|
|
|
35772
35773
|
return result;
|
|
35773
35774
|
}
|
|
35774
35775
|
//#endregion
|
|
35775
|
-
//#region ../../node_modules/.pnpm/magic-string@1.2.
|
|
35776
|
+
//#region ../../node_modules/.pnpm/magic-string@1.2.3/node_modules/magic-string/dist/index.mjs
|
|
35776
35777
|
var BitSet = class BitSet {
|
|
35777
35778
|
constructor(arg) {
|
|
35778
35779
|
this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
|
|
@@ -36473,8 +36474,8 @@ var MagicString = class MagicString {
|
|
|
36473
36474
|
end = end + this.offset;
|
|
36474
36475
|
if (typeof content !== "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
|
|
36475
36476
|
if (this.original.length !== 0) {
|
|
36476
|
-
|
|
36477
|
-
|
|
36477
|
+
if (start < 0) start = Math.max(0, start + this.original.length);
|
|
36478
|
+
if (end < 0) end = Math.max(0, end + this.original.length);
|
|
36478
36479
|
}
|
|
36479
36480
|
if (start < 0) throw new MagicStringError(`start ${start} is out of bounds`);
|
|
36480
36481
|
if (end > this.original.length) throw new MagicStringError(`end ${end} is out of bounds`);
|
|
@@ -36557,8 +36558,8 @@ var MagicString = class MagicString {
|
|
|
36557
36558
|
start = start + this.offset;
|
|
36558
36559
|
end = end + this.offset;
|
|
36559
36560
|
if (this.original.length !== 0) {
|
|
36560
|
-
|
|
36561
|
-
|
|
36561
|
+
if (start < 0) start = Math.max(0, start + this.original.length);
|
|
36562
|
+
if (end < 0) end = Math.max(0, end + this.original.length);
|
|
36562
36563
|
}
|
|
36563
36564
|
if (start === end) return this;
|
|
36564
36565
|
if (start < 0 || end > this.original.length) throw new MagicStringError(`range ${start}–${end} is out of bounds`);
|
|
@@ -36581,8 +36582,8 @@ var MagicString = class MagicString {
|
|
|
36581
36582
|
start = start + this.offset;
|
|
36582
36583
|
end = end + this.offset;
|
|
36583
36584
|
if (this.original.length !== 0) {
|
|
36584
|
-
|
|
36585
|
-
|
|
36585
|
+
if (start < 0) start = Math.max(0, start + this.original.length);
|
|
36586
|
+
if (end < 0) end = Math.max(0, end + this.original.length);
|
|
36586
36587
|
}
|
|
36587
36588
|
if (start === end) return this;
|
|
36588
36589
|
if (start < 0 || end > this.original.length) throw new MagicStringError(`range ${start}–${end} is out of bounds`);
|
|
@@ -36643,8 +36644,8 @@ var MagicString = class MagicString {
|
|
|
36643
36644
|
start = start + this.offset;
|
|
36644
36645
|
end = end + this.offset;
|
|
36645
36646
|
if (this.original.length !== 0) {
|
|
36646
|
-
|
|
36647
|
-
|
|
36647
|
+
if (start < 0) start = Math.max(0, start + this.original.length);
|
|
36648
|
+
if (end < 0) end = Math.max(0, end + this.original.length);
|
|
36648
36649
|
}
|
|
36649
36650
|
let result = "";
|
|
36650
36651
|
let chunk = this.firstChunk;
|
|
@@ -36830,27 +36831,19 @@ var MagicString = class MagicString {
|
|
|
36830
36831
|
});
|
|
36831
36832
|
else return replacement(match[0], ...match.slice(1), match.index, str, match.groups);
|
|
36832
36833
|
}
|
|
36833
|
-
|
|
36834
|
-
|
|
36835
|
-
|
|
36836
|
-
|
|
36837
|
-
|
|
36838
|
-
|
|
36839
|
-
|
|
36840
|
-
|
|
36841
|
-
|
|
36842
|
-
|
|
36843
|
-
|
|
36844
|
-
const replacement = getReplacement(match, this.original);
|
|
36845
|
-
if (replacement !== match[0]) this.overwrite(match.index, match.index + match[0].length, replacement);
|
|
36846
|
-
}
|
|
36847
|
-
});
|
|
36848
|
-
else {
|
|
36834
|
+
const replaceMatch = (match) => {
|
|
36835
|
+
if (match.index == null) return;
|
|
36836
|
+
const replacement = getReplacement(match, this.original);
|
|
36837
|
+
if (replacement === match[0]) return;
|
|
36838
|
+
if (match[0].length === 0) this.appendRight(match.index, replacement);
|
|
36839
|
+
else this.overwrite(match.index, match.index + match[0].length, replacement);
|
|
36840
|
+
};
|
|
36841
|
+
if (searchValue.global) {
|
|
36842
|
+
searchValue.lastIndex = 0;
|
|
36843
|
+
for (const match of this.original.matchAll(searchValue)) replaceMatch(match);
|
|
36844
|
+
} else {
|
|
36849
36845
|
const match = this.original.match(searchValue);
|
|
36850
|
-
if (match
|
|
36851
|
-
const replacement = getReplacement(match, this.original);
|
|
36852
|
-
if (replacement !== match[0]) this.overwrite(match.index, match.index + match[0].length, replacement);
|
|
36853
|
-
}
|
|
36846
|
+
if (match) replaceMatch(match);
|
|
36854
36847
|
}
|
|
36855
36848
|
return this;
|
|
36856
36849
|
}
|
|
@@ -36860,7 +36853,8 @@ var MagicString = class MagicString {
|
|
|
36860
36853
|
const index = original.indexOf(string);
|
|
36861
36854
|
if (index !== -1) {
|
|
36862
36855
|
if (typeof replacement === "function") replacement = replacement(string, index, original);
|
|
36863
|
-
if (string !== replacement)
|
|
36856
|
+
if (string !== replacement) if (string.length === 0) this.appendRight(index, replacement);
|
|
36857
|
+
else this.overwrite(index, index + string.length, replacement);
|
|
36864
36858
|
}
|
|
36865
36859
|
return this;
|
|
36866
36860
|
}
|
|
@@ -36875,6 +36869,13 @@ var MagicString = class MagicString {
|
|
|
36875
36869
|
_replaceAllString(string, replacement) {
|
|
36876
36870
|
const { original } = this;
|
|
36877
36871
|
const stringLength = string.length;
|
|
36872
|
+
if (stringLength === 0) {
|
|
36873
|
+
for (let index = 0; index <= original.length; index += 1) {
|
|
36874
|
+
const _replacement = typeof replacement === "function" ? replacement("", index, original) : replacement;
|
|
36875
|
+
if (_replacement !== "") this.appendRight(index, _replacement);
|
|
36876
|
+
}
|
|
36877
|
+
return this;
|
|
36878
|
+
}
|
|
36878
36879
|
for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) {
|
|
36879
36880
|
const previous = original.slice(index, index + stringLength);
|
|
36880
36881
|
const _replacement = typeof replacement === "function" ? replacement(previous, index, original) : replacement;
|
|
@@ -38450,11 +38451,17 @@ function updateWhitespaceGap(ms, start, end, options) {
|
|
|
38450
38451
|
}));
|
|
38451
38452
|
}
|
|
38452
38453
|
function updateWxmlSegment(ms, start, end, options, keepEOL, ignoreHead) {
|
|
38453
|
-
|
|
38454
|
+
const value = ms.slice(start, end);
|
|
38455
|
+
const replaceOptions = {
|
|
38454
38456
|
keepEOL,
|
|
38455
38457
|
escapeMap: options.escapeMap,
|
|
38456
38458
|
ignoreHead
|
|
38457
|
-
}
|
|
38459
|
+
};
|
|
38460
|
+
if (options.classSetMode === "exact" && options.runtimeSet) {
|
|
38461
|
+
ms.update(start, end, value.replace(/\S+/g, (candidate) => options.runtimeSet.has(candidate) ? replaceWxml(candidate, replaceOptions) : candidate));
|
|
38462
|
+
return;
|
|
38463
|
+
}
|
|
38464
|
+
ms.update(start, end, replaceWxml(value, replaceOptions));
|
|
38458
38465
|
}
|
|
38459
38466
|
function updateExpressionSegment(ms, exp, options) {
|
|
38460
38467
|
const code = `{{${generateCode(exp.value.slice(2, -2), options)}}}`;
|
|
@@ -38569,6 +38576,7 @@ function createTemplateHandler(options = {}) {
|
|
|
38569
38576
|
let cachedOptionsWithRuntimeSet;
|
|
38570
38577
|
return (rawSource, opt) => {
|
|
38571
38578
|
const runtimeSet = opt?.runtimeSet;
|
|
38579
|
+
if (opt && Object.keys(opt).some((key) => key !== "runtimeSet")) return customTemplateHandler(rawSource, (0, _weapp_tailwindcss_shared.defuOverrideArray)(opt, defaultOptions), opt.customAttributesEntities === void 0 ? cachedMatcher : void 0);
|
|
38572
38580
|
if (runtimeSet === void 0) return customTemplateHandler(rawSource, defaultOptions, cachedMatcher);
|
|
38573
38581
|
if (cachedRuntimeSet !== runtimeSet || !cachedOptionsWithRuntimeSet) {
|
|
38574
38582
|
cachedRuntimeSet = runtimeSet;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.4.0",
|
|
5
5
|
"description": "Bring Tailwind CSS to every platform! 把 Tailwind CSS 的原子化开发体验带到全端!",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"homepage": "https://tw.
|
|
8
|
+
"homepage": "https://tw.weapp.dev",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "git+https://github.com/sonofmagic/weapp-tailwindcss.git",
|
|
@@ -198,6 +198,10 @@
|
|
|
198
198
|
"@tailwindcss-mangle/engine": "0.2.0",
|
|
199
199
|
"@vue/compiler-dom": "^3.5.41",
|
|
200
200
|
"@weapp-core/escape": "~8.0.0",
|
|
201
|
+
"@weapp-tailwindcss/logger": "2.0.3",
|
|
202
|
+
"@weapp-tailwindcss/postcss": "3.2.12",
|
|
203
|
+
"@weapp-tailwindcss/reset": "0.1.4",
|
|
204
|
+
"@weapp-tailwindcss/shared": "2.0.3",
|
|
201
205
|
"comment-json": "^5.0.0",
|
|
202
206
|
"debug": "~4.4.3",
|
|
203
207
|
"fast-glob": "^3.3.3",
|
|
@@ -205,18 +209,14 @@
|
|
|
205
209
|
"lightningcss": "^1.33.0",
|
|
206
210
|
"local-pkg": "^1.2.1",
|
|
207
211
|
"lru-cache": "11.5.2",
|
|
208
|
-
"magic-string": "^1.2.
|
|
212
|
+
"magic-string": "^1.2.3",
|
|
209
213
|
"micromatch": "^4.0.8",
|
|
210
|
-
"oxc-parser": "^0.
|
|
214
|
+
"oxc-parser": "^0.147.0",
|
|
211
215
|
"oxc-walker": "^1.1.1",
|
|
212
216
|
"semver": "~7.8.5",
|
|
213
|
-
"
|
|
214
|
-
"
|
|
215
|
-
"
|
|
216
|
-
"@weapp-tailwindcss/shared": "2.0.2",
|
|
217
|
-
"weapp-style-injector": "1.0.3",
|
|
218
|
-
"tailwindcss-config": "2.0.3",
|
|
219
|
-
"@weapp-tailwindcss/reset": "0.1.3"
|
|
217
|
+
"tailwindcss-config": "2.0.4",
|
|
218
|
+
"weapp-style-injector": "1.0.4",
|
|
219
|
+
"yaml": "^2.9.0"
|
|
220
220
|
},
|
|
221
221
|
"devDependencies": {
|
|
222
222
|
"@mpxjs/webpack-plugin": "^2.11.1",
|
|
@@ -233,6 +233,7 @@
|
|
|
233
233
|
"test:dev": "vitest",
|
|
234
234
|
"test:ui": "vitest --ui",
|
|
235
235
|
"bench": "vitest bench --config ./vitest.config.ts",
|
|
236
|
+
"bench:core-compiler": "node --expose-gc --import tsx benchmark/core-compiler.ts",
|
|
236
237
|
"bench:vite-perf": "pnpm --filter @weapp-tailwindcss/scripts bench:vite-perf",
|
|
237
238
|
"bench:vite-perf:summary": "pnpm --filter @weapp-tailwindcss/scripts bench:vite-perf:summary",
|
|
238
239
|
"bench:js-handlers": "pnpm --filter @weapp-tailwindcss/scripts bench:js-handlers",
|