weapp-tailwindcss 5.5.4 → 5.5.6
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/gulp/shared/create-native-framework-plugins/file-transforms.d.ts +5 -4
- package/dist/bundlers/shared/final-css-cleanup.d.ts +1 -2
- package/dist/bundlers/shared/framework-css-composition.d.ts +1 -0
- package/dist/bundlers/shared/framework-postcss.d.ts +2 -1
- package/dist/bundlers/shared/framework-user-css.d.ts +1 -0
- package/dist/bundlers/shared/generated-css-marker.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/generation-helpers/results.d.ts +5 -7
- package/dist/bundlers/shared/generator-css/legacy-compat.d.ts +4 -1
- package/dist/bundlers/shared/generator-css/legacy-selectors.d.ts +1 -4
- package/dist/bundlers/shared/generator-css/legacy-units.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/pipeline/context.d.ts +4 -2
- package/dist/bundlers/shared/generator-css/source-resolver/apply-reference.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/types.d.ts +6 -3
- package/dist/bundlers/shared/generator-css/user-css/apply-only.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/user-css/compile-functions.d.ts +4 -0
- package/dist/bundlers/shared/generator-css/user-css/generated-cleanup.d.ts +3 -1
- package/dist/bundlers/shared/generator-css/user-css/source-fragments.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/user-css/transform.d.ts +3 -0
- package/dist/bundlers/shared/style-handler-options.d.ts +7 -0
- package/dist/bundlers/shared/v4-generation-core.d.ts +0 -1
- package/dist/bundlers/vite/css-finalizer/css-calc.d.ts +3 -0
- package/dist/bundlers/vite/css-finalizer/final-assets.d.ts +3 -0
- package/dist/bundlers/vite/css-handler-options.d.ts +1 -1
- package/dist/bundlers/vite/frameworks/generic/web.d.ts +2 -1
- package/dist/bundlers/vite/generate-bundle/css-transform-decision-plan.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/finalize/sync-processed-css.d.ts +4 -0
- package/dist/bundlers/vite/generate-bundle/framework-style-memory.d.ts +4 -0
- package/dist/bundlers/vite/generate-bundle/js-handler-options.d.ts +7 -0
- package/dist/bundlers/vite/generate-bundle/remembered-css.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/rollup-assets.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/runtime.d.ts +3 -1
- package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/temporary-css-assets.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/types.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/web-css-module.d.ts +1 -0
- package/dist/bundlers/vite/plugin-hook.d.ts +3 -0
- package/dist/bundlers/vite/processed-css-assets/coverage.d.ts +3 -1
- package/dist/bundlers/vite/processed-css-assets/markers-imports.d.ts +1 -1
- package/dist/bundlers/vite/processed-css-assets/scoped-tailwind-noise.d.ts +1 -1
- package/dist/bundlers/vite/shared/create-framework-plugins-runtime.d.ts +3 -1
- package/dist/bundlers/vite/shared/framework-module-candidates.d.ts +2 -1
- package/dist/bundlers/vite/shared/framework-runtime-configuration.d.ts +3 -0
- package/dist/bundlers/vite/shared/framework-runtime-options.d.ts +9 -0
- package/dist/bundlers/vite/shared/framework-runtime-utils.d.ts +6 -5
- package/dist/bundlers/vite/shared/framework-source-scan-session.d.ts +3 -3
- package/dist/bundlers/vite/shared/framework-strategy.d.ts +3 -1
- package/dist/bundlers/vite/shared/hmr-source.d.ts +2 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/processed-css-task.d.ts +2 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +1 -1
- package/dist/bundlers/webpack/shared/create-framework-plugin/plugin.d.ts +1 -1
- package/dist/compiler/index.d.ts +2 -0
- package/dist/compiler/semantic-css.d.ts +1 -1
- package/dist/compiler/types.d.ts +1 -1
- package/dist/{compiler-DFROuh5Z.cjs → compiler-C8FqI-P3.cjs} +1060 -1163
- package/dist/{compiler-CJ5yX-on.js → compiler-D3GBwxoa.js} +32 -23
- package/dist/core/compiler/transforms.d.ts +1 -1
- package/dist/core.cjs +4 -4
- package/dist/core.js +4 -4
- package/dist/{css-imports-_5cwJnx-.cjs → css-imports-XvtI1zCY.cjs} +2 -3
- package/dist/css-macro.cjs +1 -1
- package/dist/css-macro.js +1 -1
- package/dist/{defaults-CKx-4LcW.js → defaults-AQuvJS-h.js} +4 -2
- package/dist/{defaults-CiGsr8Xq.cjs → defaults-CyX5iO9y.cjs} +4 -2
- package/dist/defaults.cjs +1 -1
- package/dist/defaults.js +1 -1
- package/dist/final-css-cleanup-CDTmVAye.cjs +1 -0
- package/dist/{final-css-cleanup-B0HUBtiE.js → final-css-cleanup-u_sI2p56.js} +1 -126
- package/dist/framework/index.d.ts +1 -1
- package/dist/framework/platform.d.ts +2 -2
- package/dist/{generator-RK2HtgOb.cjs → generator-Bvr4WmuF.cjs} +150 -150
- package/dist/{generator-BgbYHNgD.js → generator-C0BJjyLM.js} +131 -131
- package/dist/generator.cjs +1 -1
- package/dist/generator.js +1 -1
- package/dist/{gulp-BS7fTmyj.cjs → gulp-BExe5RBF.cjs} +8 -8
- package/dist/{gulp-nl-2p5Dw.js → gulp-BhkIIk7J.js} +5 -5
- package/dist/gulp.cjs +1 -1
- package/dist/gulp.js +1 -1
- package/dist/{hmr-timing-BfxWwMeT.js → hmr-timing-B9Yt86-U.js} +299 -404
- package/dist/{hmr-timing-D45cTIzM.cjs → hmr-timing-CoiJIqDu.cjs} +4 -4
- package/dist/index.cjs +4 -4
- package/dist/index.js +4 -4
- package/dist/js/NodePathWalker.d.ts +1 -1
- package/dist/js/node-path-walker/export-handlers.d.ts +1 -1
- package/dist/js/node-path-walker/import-tokens.d.ts +1 -1
- package/dist/{pipeline-helpers-BEhISt4D.cjs → pipeline-helpers-BOjTEmMi.cjs} +6 -6
- 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 +2 -2
- package/dist/rspack.js +2 -2
- package/dist/{scoped-generator-Dqq2iLky.js → scoped-generator-B6Y1bxzM.js} +46 -31
- package/dist/{scoped-generator-DccPwmJT.cjs → scoped-generator-BUBls_oM.cjs} +46 -31
- package/dist/{source-candidate-scan-signature-CnUlGWhP.cjs → source-candidate-scan-signature-BtJZp28T.cjs} +32 -3
- package/dist/{source-candidate-scan-signature-BJkQJtRM.js → source-candidate-scan-signature-DNuGKTqf.js} +21 -4
- package/dist/style-injector/internal.d.ts +118 -8
- package/dist/style-injector/options.d.ts +5 -1
- package/dist/tailwindcss/runtime-options.d.ts +5 -0
- package/dist/tailwindcss/v4/preflight.d.ts +0 -1
- package/dist/tailwindcss/v4-engine/generator/incremental-cache.d.ts +1 -0
- package/dist/tailwindcss/v4-engine/generator/style-context.d.ts +4 -0
- package/dist/{tailwindcss-o3Xe-o7M.js → tailwindcss-B_4E52WF.js} +7 -13
- package/dist/{tailwindcss-B03BGeTO.cjs → tailwindcss-CBYjzRmV.cjs} +4 -10
- package/dist/{transform-BVH7iLHn.js → transform-CkEnJYIP.js} +18 -12
- package/dist/{transform-MIhriZRr.cjs → transform-FkqbTBJR.cjs} +17 -11
- package/dist/types/index.d.ts +3 -2
- package/dist/uni-app-x/border-preflight.d.ts +1 -2
- package/dist/uni-app-x/component-local-style.d.ts +2 -1
- package/dist/uni-app-x/transform.d.ts +4 -2
- package/dist/uni-app-x/vite/author-apply.d.ts +3 -1
- package/dist/uni-app-x/vite/native-hmr.d.ts +1 -1
- package/dist/uni-app-x/vite/style-result.d.ts +5 -0
- package/dist/{v4-generation-core-BvW2aK23.cjs → v4-generation-core-Cz1D7wm1.cjs} +313 -418
- package/dist/vite/web.cjs +1 -1
- package/dist/vite/web.js +1 -1
- package/dist/{vite-4RznbXVI.cjs → vite-DxuKPZlp.cjs} +565 -592
- package/dist/{vite-hGECCqfq.js → vite-lP35OguX.js} +558 -578
- package/dist/vite-web.d.ts +1 -1
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/dist/weapp-tw-css-generation-loader.cjs +2 -2
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +7 -7
- package/dist/{web-0FAisq6H.js → web-Dfz_jpNj.js} +144 -107
- package/dist/{web-DQZ27KWH.cjs → web-DhDxhlkq.cjs} +156 -107
- package/dist/{webpack-8cQlXIo4.js → webpack-D6jp1o3m.js} +18 -17
- package/dist/{webpack-DOQ_3ViW.cjs → webpack-R2Sbggiy.cjs} +20 -20
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.js +1 -1
- package/dist/wxml/utils/codegen/legacy-visitor.d.ts +2 -2
- package/dist/wxml/utils/custom-template.d.ts +1 -1
- package/package.json +9 -11
- package/dist/final-css-cleanup-DSjczga3.cjs +0 -138
- package/dist/tailwindcss/v4-engine/css-import.d.ts +0 -14
- package/dist/uni-app-x/style-asset/source-parser.d.ts +0 -2
|
@@ -1,15 +1,15 @@
|
|
|
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-Bvr4WmuF.cjs");
|
|
3
|
+
const require_tailwindcss = require("./tailwindcss-CBYjzRmV.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-Cz1D7wm1.cjs");
|
|
6
|
+
const require_compiler = require("./compiler-C8FqI-P3.cjs");
|
|
7
7
|
const require_runtime_state = require("./runtime-state-XYSycuGu.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-
|
|
9
|
+
const require_hmr_timing = require("./hmr-timing-CoiJIqDu.cjs");
|
|
10
|
+
const require_scoped_generator = require("./scoped-generator-BUBls_oM.cjs");
|
|
11
|
+
const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-BtJZp28T.cjs");
|
|
12
|
+
const require_pipeline_helpers = require("./pipeline-helpers-BOjTEmMi.cjs");
|
|
13
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");
|
|
@@ -186,7 +186,7 @@ function dirnameWebpackResourcePath(file) {
|
|
|
186
186
|
return node_path.default.dirname(file);
|
|
187
187
|
}
|
|
188
188
|
function resolveWebpackCssAssetModuleResource(resource, issuer, options) {
|
|
189
|
-
if (!isCssLikeModuleResource(resource, options.cssMatcher
|
|
189
|
+
if (!isCssLikeModuleResource(resource, options.cssMatcher)) return;
|
|
190
190
|
const normalized = stripResourceQuery(resource);
|
|
191
191
|
if (!normalized) return;
|
|
192
192
|
const absoluteResource = resolveWebpackResourcePath(normalized);
|
|
@@ -642,7 +642,7 @@ async function processWebpackGeneratedCssAsset(element, context) {
|
|
|
642
642
|
for (const dependency of loaderGeneratedCss.dependencies) compilation.fileDependencies?.add?.(dependency);
|
|
643
643
|
const currentRawSourceWithoutBundlerMarkers = require_v4_generation_core.stripBundlerGeneratedCssMarkers(currentRawSource);
|
|
644
644
|
const currentAssetHasProcessedUrl = require_pipeline_helpers.hasProcessedCssAssetUrl(currentRawSourceWithoutBundlerMarkers) && currentRawSourceWithoutBundlerMarkers !== loaderGeneratedCss.css;
|
|
645
|
-
const currentAssetUserCss = currentAssetHasProcessedUrl ? currentRawSourceWithoutBundlerMarkers : require_pipeline_helpers.shouldUseWebpackAssetAsGeneratorUserCss(currentRawSourceWithoutBundlerMarkers, loaderGeneratedCss.css, { processed: true }) ?
|
|
645
|
+
const currentAssetUserCss = currentAssetHasProcessedUrl ? currentRawSourceWithoutBundlerMarkers : require_pipeline_helpers.shouldUseWebpackAssetAsGeneratorUserCss(currentRawSourceWithoutBundlerMarkers, loaderGeneratedCss.css, { processed: true }) ? (0, _weapp_tailwindcss_postcss.removeGeneratedSelectorCompatCss)(currentRawSourceWithoutBundlerMarkers, loaderGeneratedCss.css) : void 0;
|
|
646
646
|
const loaderGeneratedCssWithoutMarkers = require_v4_generation_core.stripBundlerGeneratedCssMarkers(loaderGeneratedCss.css);
|
|
647
647
|
const currentAssetUserCssWithoutMarkers = currentAssetUserCss === void 0 ? "" : require_v4_generation_core.stripBundlerGeneratedCssMarkers(currentAssetUserCss);
|
|
648
648
|
const currentAssetMissingUserCss = !(currentAssetUserCssWithoutMarkers.trim().length > 0 && !require_generator.isCommentOnlyCss(currentAssetUserCssWithoutMarkers)) ? "" : (0, _weapp_tailwindcss_postcss.filterExistingCssRules)(currentAssetUserCssWithoutMarkers, loaderGeneratedCssWithoutMarkers);
|
|
@@ -655,7 +655,7 @@ async function processWebpackGeneratedCssAsset(element, context) {
|
|
|
655
655
|
return { result: new ConcatSource(finalizeTracedCss(userCss, cssHandlerOptions)) };
|
|
656
656
|
}
|
|
657
657
|
const mergedLoaderCss = currentAssetUserCss === void 0 ? loaderGeneratedCss.css : require_pipeline_helpers.createWebpackGeneratorUserCssSourceAppend({
|
|
658
|
-
css: currentAssetUserCss === void 0 ? loaderGeneratedCss.css : currentAssetHasProcessedUrl ?
|
|
658
|
+
css: currentAssetUserCss === void 0 ? loaderGeneratedCss.css : currentAssetHasProcessedUrl ? (0, _weapp_tailwindcss_postcss.removeGeneratedSelectorCompatCss)(loaderGeneratedCss.css, currentAssetUserCss) : (0, _weapp_tailwindcss_postcss.filterExistingCssRules)(currentAssetUserCss, loaderGeneratedCss.css),
|
|
659
659
|
processed: true
|
|
660
660
|
}, currentAssetUserCss === void 0 ? void 0 : {
|
|
661
661
|
css: currentAssetUserCss,
|
|
@@ -1744,8 +1744,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
1744
1744
|
debug
|
|
1745
1745
|
});
|
|
1746
1746
|
for (const [file, asset] of groupedEntries.css) {
|
|
1747
|
-
const
|
|
1748
|
-
const source = require_pipeline_helpers.stringifyWebpackSourceLike(rawSource);
|
|
1747
|
+
const source = (compilation.getAsset(file)?.source.source() ?? asset.source()).toString();
|
|
1749
1748
|
updateAssetIfChanged(file, require_pipeline_helpers.finalizeWebpackCssAssetOutputSource(source, compilerOptions, isWebGeneratorTarget));
|
|
1750
1749
|
}
|
|
1751
1750
|
});
|
|
@@ -1961,7 +1960,7 @@ function addMpxWebpackPluginAlias(alias, pkgDir) {
|
|
|
1961
1960
|
}
|
|
1962
1961
|
];
|
|
1963
1962
|
const managedNames = new Set(entries.filter((entry) => typeof entry.name === "string").map((entry) => entry.name));
|
|
1964
|
-
const managedPatterns = new Set(entries.
|
|
1963
|
+
const managedPatterns = new Set(entries.flatMap((entry) => entry.name instanceof RegExp ? [`${entry.name.source}/${entry.name.flags}`] : []));
|
|
1965
1964
|
for (let index = alias.length - 1; index >= 0; index--) {
|
|
1966
1965
|
const name = alias[index]?.name;
|
|
1967
1966
|
if (managedNames.has(name) || name instanceof RegExp && managedPatterns.has(`${name.source}/${name.flags}`)) alias.splice(index, 1);
|
|
@@ -2233,7 +2232,7 @@ function setupWebpackV5Loaders(options) {
|
|
|
2233
2232
|
const isLynxMainThreadCss = compilerOptions.platform === "lynx" && (module.layer === "react:main-thread" || loaderEntries.some((entry) => entry.loader?.includes?.("ignore-css-loader")));
|
|
2234
2233
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
2235
2234
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
2236
|
-
const isCssModule = isCssLikeModuleResource(module.resource, compilerOptions.cssMatcher
|
|
2235
|
+
const isCssModule = isCssLikeModuleResource(module.resource, compilerOptions.cssMatcher);
|
|
2237
2236
|
if (isCssModule) {
|
|
2238
2237
|
const frameworkPostcssOptions = require_v4_generation_core.collectFrameworkPostcssOptionsFromLoaderEntries(loaderEntries, _loaderContext);
|
|
2239
2238
|
if (frameworkPostcssOptions) require_v4_generation_core.captureResolvedFrameworkPostcssOptions(compilerOptions, frameworkPostcssOptions);
|
|
@@ -2264,7 +2263,7 @@ function setupWebpackV5Loaders(options) {
|
|
|
2264
2263
|
if (cssImportRewriteLoaderOptions && runtimeCssImportRewriteLoaderExists && runtimeCssImportRewriteLoader && isCssModule && !isLynxMainThreadCss) {
|
|
2265
2264
|
const existingIndex = loaderEntries.findIndex((entry) => entry.loader?.includes?.(runtimeCssImportRewriteLoader));
|
|
2266
2265
|
const existingOptions = existingIndex === -1 ? void 0 : loaderEntries[existingIndex]?.options;
|
|
2267
|
-
const generateInRegisteredLoader = typeof existingOptions === "object" && existingOptions !== null && "generateCss" in existingOptions && existingOptions
|
|
2266
|
+
const generateInRegisteredLoader = typeof existingOptions === "object" && existingOptions !== null && "generateCss" in existingOptions && existingOptions["generateCss"] === true;
|
|
2268
2267
|
const rewriteLoaderEntry = existingIndex !== -1 ? {
|
|
2269
2268
|
...loaderEntries.splice(existingIndex, 1)[0],
|
|
2270
2269
|
loader: runtimeCssImportRewriteLoader,
|
|
@@ -2331,6 +2330,7 @@ function appendIgnoredPath(ignored, ignoredPath) {
|
|
|
2331
2330
|
return createOutputIgnoredPredicate(normalizeIgnoredList(ignored), ignoredPath);
|
|
2332
2331
|
}
|
|
2333
2332
|
function setupWebpackWatchOutputIgnore(compiler) {
|
|
2333
|
+
const compilerOptions = compiler.options;
|
|
2334
2334
|
const appendOutputIgnoredPath = (watchOptions, outputPath) => {
|
|
2335
2335
|
const resolvedOutputPath = outputPath || compiler.outputPath || compiler.options?.output?.path;
|
|
2336
2336
|
const paths = resolvedOutputPath && node_path.default.win32.isAbsolute(resolvedOutputPath) && !node_path.default.posix.isAbsolute(resolvedOutputPath) ? node_path.default.win32 : node_path.default;
|
|
@@ -2344,8 +2344,8 @@ function setupWebpackWatchOutputIgnore(compiler) {
|
|
|
2344
2344
|
}
|
|
2345
2345
|
return { ignored: appendIgnoredPath(void 0, outputDir) };
|
|
2346
2346
|
};
|
|
2347
|
-
const compilerWatchOptions = appendOutputIgnoredPath(
|
|
2348
|
-
if (compilerWatchOptions)
|
|
2347
|
+
const compilerWatchOptions = appendOutputIgnoredPath(compilerOptions.watchOptions);
|
|
2348
|
+
if (compilerWatchOptions) compilerOptions.watchOptions = compilerWatchOptions;
|
|
2349
2349
|
const syncOutputIgnoredPath = () => {
|
|
2350
2350
|
const outputPath = compiler.outputPath || compiler.options?.output?.path;
|
|
2351
2351
|
const watchOptions = compiler.watching?.watchOptions;
|
|
@@ -2357,8 +2357,8 @@ function setupWebpackWatchOutputIgnore(compiler) {
|
|
|
2357
2357
|
const watchOptions = compiler.watching?.watchOptions;
|
|
2358
2358
|
if (watchOptions) appendOutputIgnoredPath(watchOptions, outputPath);
|
|
2359
2359
|
else {
|
|
2360
|
-
const compilerWatchOptions = appendOutputIgnoredPath(
|
|
2361
|
-
if (compilerWatchOptions)
|
|
2360
|
+
const compilerWatchOptions = appendOutputIgnoredPath(compilerOptions.watchOptions, outputPath);
|
|
2361
|
+
if (compilerWatchOptions) compilerOptions.watchOptions = compilerWatchOptions;
|
|
2362
2362
|
}
|
|
2363
2363
|
});
|
|
2364
2364
|
}
|
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-R2Sbggiy.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-D6jp1o3m.js";
|
|
2
2
|
export { WeappTailwindcss, WeappTailwindcss as weappTailwindcss, weappTailwindcssPackageDir };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { TraverseOptions } from '@babel/traverse';
|
|
1
|
+
import type { TraverseOptions, Visitor } from '@babel/traverse';
|
|
2
2
|
import type { JsTokenUpdater } from '../../../js/JsTokenUpdater.js';
|
|
3
3
|
import type { ITemplateHandlerOptions } from '../../../types/index.js';
|
|
4
|
-
export declare function createLegacyTraverseOptions(options: ITemplateHandlerOptions, jsTokenUpdater: JsTokenUpdater): TraverseOptions & {
|
|
4
|
+
export declare function createLegacyTraverseOptions(options: ITemplateHandlerOptions, jsTokenUpdater: JsTokenUpdater): TraverseOptions & Visitor & {
|
|
5
5
|
noScope: true;
|
|
6
6
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ITemplateHandlerOptions } from '../../types/index.js';
|
|
2
2
|
import type { AttributeMatcher } from '../custom-attributes.js';
|
|
3
|
-
export declare function customTemplateHandler(rawSource: string, options:
|
|
3
|
+
export declare function customTemplateHandler(rawSource: string, options: ITemplateHandlerOptions, cachedMatcher?: AttributeMatcher | undefined): Promise<string>;
|
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.6",
|
|
5
5
|
"description": "Bring Tailwind CSS to every platform! 把 Tailwind CSS 的原子化开发体验带到全端!",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -201,36 +201,34 @@
|
|
|
201
201
|
}
|
|
202
202
|
},
|
|
203
203
|
"dependencies": {
|
|
204
|
-
"@babel/parser": "^8.0.
|
|
205
|
-
"@babel/traverse": "^8.0.
|
|
206
|
-
"@babel/types": "^8.0.
|
|
207
|
-
"@csstools/css-tokenizer": "^4.0.0",
|
|
204
|
+
"@babel/parser": "^8.0.5",
|
|
205
|
+
"@babel/traverse": "^8.0.5",
|
|
206
|
+
"@babel/types": "^8.0.5",
|
|
208
207
|
"@tailwindcss-mangle/engine": "0.2.0",
|
|
209
208
|
"@vue/compiler-dom": "^3.5.41",
|
|
210
209
|
"@weapp-core/escape": "~8.0.0",
|
|
211
210
|
"@weapp-tailwindcss/logger": "2.0.3",
|
|
212
|
-
"@weapp-tailwindcss/postcss": "3.3.
|
|
211
|
+
"@weapp-tailwindcss/postcss": "3.3.5",
|
|
213
212
|
"@weapp-tailwindcss/reset": "0.1.4",
|
|
214
213
|
"@weapp-tailwindcss/shared": "2.0.3",
|
|
215
214
|
"comment-json": "^5.0.0",
|
|
216
215
|
"debug": "~4.4.3",
|
|
217
216
|
"fast-glob": "^3.3.3",
|
|
218
217
|
"htmlparser2": "^12.0.0",
|
|
219
|
-
"lightningcss": "^1.33.0",
|
|
220
218
|
"local-pkg": "^1.2.1",
|
|
221
219
|
"lru-cache": "11.5.2",
|
|
222
|
-
"magic-string": "^1.
|
|
220
|
+
"magic-string": "^1.4.1",
|
|
223
221
|
"micromatch": "^4.0.8",
|
|
224
|
-
"oxc-parser": "^0.
|
|
222
|
+
"oxc-parser": "^0.150.0",
|
|
225
223
|
"oxc-walker": "^1.1.1",
|
|
226
|
-
"postcss-scss": "^4.0.9",
|
|
227
224
|
"semver": "~7.8.5",
|
|
228
225
|
"tailwindcss-config": "2.0.4",
|
|
229
226
|
"weapp-style-injector": "1.0.5",
|
|
230
|
-
"yaml": "^2.9.
|
|
227
|
+
"yaml": "^2.9.1"
|
|
231
228
|
},
|
|
232
229
|
"devDependencies": {
|
|
233
230
|
"@mpxjs/webpack-plugin": "^2.11.1",
|
|
231
|
+
"vite": "^7.3.6",
|
|
234
232
|
"webpack": "5.105.4"
|
|
235
233
|
},
|
|
236
234
|
"scripts": {
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
2
|
-
//#region src/bundlers/shared/final-css-cleanup.ts
|
|
3
|
-
function isCssWhitespace(code) {
|
|
4
|
-
return code === 9 || code === 10 || code === 12 || code === 13 || code === 32;
|
|
5
|
-
}
|
|
6
|
-
function isCssWordChar(code) {
|
|
7
|
-
return code >= 48 && code <= 57 || code >= 65 && code <= 90 || code >= 97 && code <= 122 || code === 95;
|
|
8
|
-
}
|
|
9
|
-
const EMPTY_CSS_BLOCK_RE = /\{(?:[\t\n\f\r ]|\/\*(?:[^*]|\*(?!\/))*\*\/)*\}/;
|
|
10
|
-
function findCssPreludeStart(css, start, end) {
|
|
11
|
-
let cursor = start;
|
|
12
|
-
while (cursor < end) {
|
|
13
|
-
while (cursor < end && isCssWhitespace(css.charCodeAt(cursor))) cursor++;
|
|
14
|
-
if (css.charCodeAt(cursor) !== 47 || css.charCodeAt(cursor + 1) !== 42) return cursor;
|
|
15
|
-
const commentEnd = css.indexOf("*/", cursor + 2);
|
|
16
|
-
if (commentEnd < 0 || commentEnd + 2 > end) return end;
|
|
17
|
-
cursor = commentEnd + 2;
|
|
18
|
-
}
|
|
19
|
-
return end;
|
|
20
|
-
}
|
|
21
|
-
function isKeyframesAtRule(css, start, end) {
|
|
22
|
-
let cursor = start + 1;
|
|
23
|
-
if (css.charCodeAt(cursor) === 45) {
|
|
24
|
-
cursor++;
|
|
25
|
-
const prefixStart = cursor;
|
|
26
|
-
while (cursor < end && isCssWordChar(css.charCodeAt(cursor))) cursor++;
|
|
27
|
-
if (cursor === prefixStart || css.charCodeAt(cursor) !== 45) return false;
|
|
28
|
-
cursor++;
|
|
29
|
-
}
|
|
30
|
-
if (cursor + 9 > end || css.slice(cursor, cursor + 9).toLowerCase() !== "keyframes") return false;
|
|
31
|
-
return !isCssWordChar(css.charCodeAt(cursor + 9));
|
|
32
|
-
}
|
|
33
|
-
function hasEmptyCssBlockCandidate(css) {
|
|
34
|
-
if (!EMPTY_CSS_BLOCK_RE.test(css)) return false;
|
|
35
|
-
const blocks = [];
|
|
36
|
-
let parenthesisDepth = 0;
|
|
37
|
-
let quote = 0;
|
|
38
|
-
let squareBracketDepth = 0;
|
|
39
|
-
let statementStart = 0;
|
|
40
|
-
for (let index = 0; index < css.length; index++) {
|
|
41
|
-
const code = css.charCodeAt(index);
|
|
42
|
-
if (quote !== 0) {
|
|
43
|
-
if (code === 92) index++;
|
|
44
|
-
else if (code === quote) quote = 0;
|
|
45
|
-
continue;
|
|
46
|
-
}
|
|
47
|
-
if (code === 34 || code === 39) {
|
|
48
|
-
quote = code;
|
|
49
|
-
if (blocks.length > 0) blocks[blocks.length - 1].hasContent = true;
|
|
50
|
-
continue;
|
|
51
|
-
}
|
|
52
|
-
if (code === 92) {
|
|
53
|
-
if (blocks.length > 0) blocks[blocks.length - 1].hasContent = true;
|
|
54
|
-
index++;
|
|
55
|
-
continue;
|
|
56
|
-
}
|
|
57
|
-
if (code === 47 && css.charCodeAt(index + 1) === 42) {
|
|
58
|
-
const commentEnd = css.indexOf("*/", index + 2);
|
|
59
|
-
if (commentEnd < 0) return false;
|
|
60
|
-
index = commentEnd + 1;
|
|
61
|
-
continue;
|
|
62
|
-
}
|
|
63
|
-
if (code === 40) {
|
|
64
|
-
parenthesisDepth++;
|
|
65
|
-
continue;
|
|
66
|
-
}
|
|
67
|
-
if (code === 41 && parenthesisDepth > 0) {
|
|
68
|
-
parenthesisDepth--;
|
|
69
|
-
continue;
|
|
70
|
-
}
|
|
71
|
-
if (code === 91) {
|
|
72
|
-
squareBracketDepth++;
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
if (code === 93 && squareBracketDepth > 0) {
|
|
76
|
-
squareBracketDepth--;
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
79
|
-
if (code === 123 && parenthesisDepth === 0 && squareBracketDepth === 0) {
|
|
80
|
-
const preludeStart = findCssPreludeStart(css, statementStart, index);
|
|
81
|
-
const isAtRule = css.charCodeAt(preludeStart) === 64;
|
|
82
|
-
const isKeyframesContainer = isAtRule && isKeyframesAtRule(css, preludeStart, index);
|
|
83
|
-
blocks.push({
|
|
84
|
-
hasContent: false,
|
|
85
|
-
isKeyframesContainer,
|
|
86
|
-
isKeyframeStep: !isAtRule && blocks[blocks.length - 1]?.isKeyframesContainer === true
|
|
87
|
-
});
|
|
88
|
-
statementStart = index + 1;
|
|
89
|
-
continue;
|
|
90
|
-
}
|
|
91
|
-
if (code === 125 && parenthesisDepth === 0 && squareBracketDepth === 0) {
|
|
92
|
-
const block = blocks.pop();
|
|
93
|
-
if (!block) continue;
|
|
94
|
-
if (!block.hasContent && !block.isKeyframeStep) return true;
|
|
95
|
-
if (blocks.length > 0) blocks[blocks.length - 1].hasContent = true;
|
|
96
|
-
statementStart = index + 1;
|
|
97
|
-
continue;
|
|
98
|
-
}
|
|
99
|
-
if (code === 59 && parenthesisDepth === 0 && squareBracketDepth === 0) {
|
|
100
|
-
statementStart = index + 1;
|
|
101
|
-
continue;
|
|
102
|
-
}
|
|
103
|
-
if (!isCssWhitespace(code) && blocks.length > 0) blocks[blocks.length - 1].hasContent = true;
|
|
104
|
-
}
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* 在小程序样式进入最终产物图时递归清理无语义的空 CSS 块。
|
|
109
|
-
*/
|
|
110
|
-
function finalizeMiniProgramCssStructure(css) {
|
|
111
|
-
const repaired = (0, _weapp_tailwindcss_postcss.repairTrailingUnclosedTailwindSourceMedia)(css);
|
|
112
|
-
if (!hasEmptyCssBlockCandidate(repaired)) return repaired;
|
|
113
|
-
try {
|
|
114
|
-
const root = _weapp_tailwindcss_postcss.postcss.parse(repaired);
|
|
115
|
-
let removed = 0;
|
|
116
|
-
let passRemoved = 0;
|
|
117
|
-
do {
|
|
118
|
-
passRemoved = (0, _weapp_tailwindcss_postcss.removeEmptyRules)(root) + (0, _weapp_tailwindcss_postcss.removeEmptyAtRules)(root);
|
|
119
|
-
removed += passRemoved;
|
|
120
|
-
} while (passRemoved > 0);
|
|
121
|
-
return removed > 0 ? root.toString() : repaired;
|
|
122
|
-
} catch {
|
|
123
|
-
return repaired;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
//#endregion
|
|
127
|
-
Object.defineProperty(exports, "finalizeMiniProgramCssStructure", {
|
|
128
|
-
enumerable: true,
|
|
129
|
-
get: function() {
|
|
130
|
-
return finalizeMiniProgramCssStructure;
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
Object.defineProperty(exports, "hasEmptyCssBlockCandidate", {
|
|
134
|
-
enumerable: true,
|
|
135
|
-
get: function() {
|
|
136
|
-
return hasEmptyCssBlockCandidate;
|
|
137
|
-
}
|
|
138
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare function parseCssImportSpecifier(params: string): {
|
|
2
|
-
specifier: string;
|
|
3
|
-
raw: string;
|
|
4
|
-
quote: string | undefined;
|
|
5
|
-
} | undefined;
|
|
6
|
-
export declare function quoteCssImportSpecifier(file: string, quote?: string): string;
|
|
7
|
-
export declare function isTailwindCssImport(params: string): boolean;
|
|
8
|
-
export declare function parseImportSourceParam(params: string): {
|
|
9
|
-
none: boolean;
|
|
10
|
-
sourcePath: undefined;
|
|
11
|
-
} | {
|
|
12
|
-
none: boolean;
|
|
13
|
-
sourcePath: string;
|
|
14
|
-
} | undefined;
|