weapp-tailwindcss 5.0.0-next.3 → 5.0.0-next.30
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 +6 -7
- package/bin/weapp-tailwindcss.js +1 -21
- package/dist/auto-TH1jG2UW.js +115 -0
- package/dist/auto-XyKTOP7B.mjs +78 -0
- package/dist/bundle-state-Bi-cQua6.mjs +413 -0
- package/dist/bundle-state-Ct_8GcSR.js +529 -0
- package/dist/bundlers/shared/cache.d.ts +6 -6
- package/dist/bundlers/shared/css-cleanup/at-rules.d.ts +1 -0
- package/dist/bundlers/shared/css-cleanup.d.ts +1 -4
- package/dist/bundlers/shared/css-imports.d.ts +3 -3
- package/dist/bundlers/shared/generated-css-marker.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/config-directive.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/directives.d.ts +20 -0
- package/dist/bundlers/shared/generator-css/legacy-compat.d.ts +7 -0
- package/dist/bundlers/shared/generator-css/legacy-selectors.d.ts +5 -0
- package/dist/bundlers/shared/generator-css/legacy-units.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/markers.d.ts +28 -0
- package/dist/bundlers/shared/generator-css/source-files.d.ts +14 -0
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +24 -0
- package/dist/bundlers/shared/generator-css.d.ts +16 -22
- package/dist/bundlers/shared/hmr-timing.d.ts +22 -0
- package/dist/bundlers/shared/style-requests.d.ts +2 -0
- package/dist/bundlers/vite/bundle-state.d.ts +1 -0
- package/dist/bundlers/vite/css-finalizer.d.ts +7 -1
- package/dist/bundlers/vite/generate-bundle/candidates.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +24 -0
- package/dist/bundlers/vite/generate-bundle/css-share-scope.d.ts +4 -0
- package/dist/bundlers/vite/generate-bundle/dirty-state.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/js-entries.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/js-handler-options.d.ts +8 -0
- package/dist/bundlers/vite/generate-bundle/js-linking.d.ts +13 -0
- package/dist/bundlers/vite/generate-bundle/metrics.d.ts +17 -0
- package/dist/bundlers/vite/generate-bundle/process-plan.d.ts +9 -0
- package/dist/bundlers/vite/generate-bundle/rollup-assets.d.ts +7 -0
- package/dist/bundlers/vite/generate-bundle/signatures.d.ts +8 -0
- package/dist/bundlers/vite/generate-bundle.d.ts +14 -2
- package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +5 -1
- package/dist/bundlers/vite/index.d.ts +5 -2
- package/dist/bundlers/vite/official-tailwind-plugins.d.ts +5 -0
- package/dist/bundlers/vite/postcss-config.d.ts +6 -0
- package/dist/bundlers/vite/processed-css-assets.d.ts +32 -0
- package/dist/bundlers/vite/rewrite-css-imports.d.ts +8 -3
- package/dist/bundlers/vite/runtime-class-set.d.ts +25 -0
- package/dist/bundlers/vite/serve-css-generation.d.ts +11 -0
- package/dist/bundlers/vite/source-candidates.d.ts +19 -1
- package/dist/bundlers/vite/source-scan.d.ts +26 -0
- package/dist/bundlers/vite/static-config-content.d.ts +5 -0
- package/dist/bundlers/vite/tailwind-basedir.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +6 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +6 -2
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +9 -3
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +2 -1
- package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +31 -0
- package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +2 -6
- package/dist/bundlers/webpack/loaders/weapp-tw-runtime-classset-loader.d.ts +3 -7
- package/dist/cache/index.d.ts +6 -6
- package/dist/{chunk-8l464Juk.js → chunk-C5U5_Hdc.js} +14 -0
- package/dist/cli/context.d.ts +1 -14
- package/dist/cli/doctor/types.d.ts +11 -11
- package/dist/cli/helpers.d.ts +1 -2
- package/dist/cli/mount-options.d.ts +2 -0
- package/dist/cli/types.d.ts +0 -2
- package/dist/cli/vscode-entry.d.ts +3 -3
- package/dist/cli.js +758 -604
- package/dist/cli.mjs +766 -612
- package/dist/constants.d.ts +1 -2
- package/dist/context/runtime-package-replacements.d.ts +2 -0
- package/dist/context/style-options.d.ts +3 -0
- package/dist/core.js +12 -20
- package/dist/core.mjs +8 -14
- package/dist/css-macro/auto.d.ts +10 -0
- package/dist/css-macro/constants.d.ts +5 -2
- package/dist/css-macro/postcss.d.ts +1 -0
- package/dist/css-macro/postcss.js +7 -46
- package/dist/css-macro/postcss.mjs +2 -46
- package/dist/css-macro.d.ts +1 -0
- package/dist/css-macro.js +16 -7
- package/dist/css-macro.mjs +15 -6
- package/dist/defaults-8xrgzxFY.mjs +151 -0
- package/dist/defaults-zKUH2mDe.js +193 -0
- package/dist/defaults.d.ts +15 -1
- package/dist/defaults.js +6 -131
- package/dist/defaults.mjs +2 -129
- package/dist/escape.js +10 -2
- package/dist/escape.mjs +10 -2
- package/dist/generator/index.d.ts +1 -1
- package/dist/generator/options.d.ts +9 -8
- package/dist/generator/types.d.ts +3 -3
- package/dist/generator-CrU-Ghc1.js +90 -0
- package/dist/generator-Qw-tZ0Z2.mjs +65 -0
- package/dist/generator.js +12 -12
- package/dist/generator.mjs +2 -1
- package/dist/gulp.js +187 -48
- package/dist/gulp.mjs +180 -41
- package/dist/incremental-runtime-class-set-BdZHkoTs.mjs +1975 -0
- package/dist/incremental-runtime-class-set-BxvZONkv.js +2038 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +19 -7
- package/dist/index.mjs +6 -5
- package/dist/js/babel/cache-options.d.ts +3 -0
- package/dist/js/babel/parse.d.ts +7 -4
- package/dist/js/index.d.ts +1 -0
- package/dist/js/literal-transform.d.ts +2 -0
- package/dist/js/precheck.d.ts +2 -2
- package/dist/logger-BNzxZbZj.mjs +2 -0
- package/dist/logger-TlKT3xmR.js +1 -0
- package/dist/postcss/config-directive.d.ts +1 -0
- package/dist/postcss/context.d.ts +9 -0
- package/dist/postcss/source-files.d.ts +8 -0
- package/dist/postcss/tailwind-version.d.ts +3 -0
- package/dist/postcss-C6zOQqlL.mjs +228 -0
- package/dist/postcss-C7BMYpEF.mjs +169 -0
- package/dist/postcss-CiYLsqZn.js +192 -0
- package/dist/postcss-DAWf9D3C.js +237 -0
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss.d.ts +2 -2
- package/dist/postcss.js +3 -276
- package/dist/postcss.mjs +1 -269
- package/dist/precheck-D7K12zeX.mjs +4716 -0
- package/dist/precheck-D7gJSmJz.js +4842 -0
- package/dist/presets/index.d.ts +1 -0
- package/dist/presets/uni-app-x.d.ts +1 -0
- package/dist/presets.js +29 -13
- package/dist/presets.mjs +25 -11
- package/dist/reset.d.ts +1 -0
- package/dist/reset.js +1 -1
- package/dist/runtime-registry-DpcR3IHI.js +5496 -0
- package/dist/shared/mpx.d.ts +1 -0
- package/dist/source-candidates-CX2ozpKM.mjs +322 -0
- package/dist/source-candidates-DNM8iwXW.js +335 -0
- package/dist/tailwindcss/miniprogram.d.ts +1 -1
- package/dist/tailwindcss/patcher-options.d.ts +3 -51
- package/dist/tailwindcss/patcher.d.ts +1 -2
- package/dist/tailwindcss/remove-unsupported-css.d.ts +1 -2
- package/dist/tailwindcss/runtime/cache.d.ts +4 -3
- package/dist/tailwindcss/runtime-patch.d.ts +5 -0
- package/dist/tailwindcss/runtime.d.ts +11 -12
- package/dist/tailwindcss/source-scan.d.ts +35 -0
- package/dist/tailwindcss/targets.d.ts +1 -5
- package/dist/tailwindcss/v3-engine/types.d.ts +17 -14
- package/dist/tailwindcss/v4/css-entries.d.ts +2 -2
- package/dist/tailwindcss/v4/css-sources.d.ts +5 -0
- package/dist/tailwindcss/v4/patcher-options.d.ts +1 -23
- package/dist/tailwindcss/v4/patcher.d.ts +1 -0
- package/dist/tailwindcss/v4-engine/source.d.ts +2 -2
- package/dist/tailwindcss/v4-engine/types.d.ts +17 -5
- package/dist/tailwindcss/version.d.ts +4 -0
- package/dist/tailwindcss-B-e2RiXr.js +642 -0
- package/dist/tailwindcss-C7dJHZ0G.mjs +591 -0
- package/dist/typedoc.export.d.ts +0 -2
- package/dist/types/index.d.ts +52 -49
- package/dist/types/shared.d.ts +6 -0
- package/dist/types/user-defined-options/general.d.ts +25 -24
- package/dist/types/user-defined-options/important.d.ts +33 -28
- package/dist/types/user-defined-options/lifecycle.d.ts +4 -4
- package/dist/types/user-defined-options/matcher.d.ts +6 -6
- package/dist/uni-app-x/vite.d.ts +1 -1
- package/dist/unocss/index.d.ts +2 -0
- package/dist/utils/disabled.d.ts +2 -3
- package/dist/utils/object.d.ts +9 -0
- package/dist/utils/options.d.ts +2 -0
- package/dist/utils/regex.d.ts +1 -0
- package/dist/{utils-DmC9_In3.js → utils-D7Ygohep.js} +2 -2
- package/dist/{utils-7DUGTFED.mjs → utils-DsaS975I.mjs} +1 -1
- package/dist/v3-engine-CHItlVq5.js +3616 -0
- package/dist/v3-engine-DcvCCHfs.mjs +3321 -0
- package/dist/vite-C65DdWEj.js +24439 -0
- package/dist/vite-rmL1rsA_.mjs +24425 -0
- package/dist/vite.d.ts +1 -2
- package/dist/vite.js +3 -4
- package/dist/vite.mjs +2 -2
- package/dist/weapp-tw-css-import-rewrite-loader.js +5032 -18
- package/dist/weapp-tw-runtime-classset-loader.js +32 -9
- package/dist/webpack-BU2Er4qg.mjs +841 -0
- package/dist/webpack-CqGvjvSQ.js +851 -0
- package/dist/webpack.d.ts +1 -3
- package/dist/webpack.js +3 -4
- package/dist/webpack.mjs +2 -2
- package/package.json +38 -48
- package/dist/bundlers/shared/generator-candidates.d.ts +0 -5
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-assets.d.ts +0 -14
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-loaders.d.ts +0 -15
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v4.d.ts +0 -9
- package/dist/bundlers/webpack/shared/css-imports.d.ts +0 -6
- package/dist/cli/config.d.ts +0 -5
- package/dist/cli/helpers/patch-cwd.d.ts +0 -1
- package/dist/cli/mount-options/patch-status.d.ts +0 -2
- package/dist/cli/patch-options.d.ts +0 -6
- package/dist/cli/tokens.d.ts +0 -4
- package/dist/cli/workspace/package-dirs.d.ts +0 -3
- package/dist/cli/workspace/patch-package.d.ts +0 -3
- package/dist/cli/workspace/patch-utils.d.ts +0 -3
- package/dist/cli/workspace/types.d.ts +0 -11
- package/dist/cli/workspace/workspace-globs.d.ts +0 -2
- package/dist/cli/workspace/workspace-io.d.ts +0 -1
- package/dist/cli/workspace/workspace-lock.d.ts +0 -1
- package/dist/cli/workspace.d.ts +0 -2
- package/dist/constants-B-_T5UnW.mjs +0 -44
- package/dist/constants-p1dyh1x1.js +0 -73
- package/dist/css-imports-BbrbluP9.js +0 -177
- package/dist/css-imports-CSdPq_Sc.mjs +0 -128
- package/dist/experimental/index.d.ts +0 -2
- package/dist/experimental/oxc/ast-utils.d.ts +0 -30
- package/dist/experimental/oxc/index.d.ts +0 -2
- package/dist/experimental/oxc/module-specifiers.d.ts +0 -2
- package/dist/experimental/shared/cache.d.ts +0 -3
- package/dist/experimental/shared/transform.d.ts +0 -3
- package/dist/experimental/shared.d.ts +0 -8
- package/dist/experimental/swc/ast-utils.d.ts +0 -30
- package/dist/experimental/swc/index.d.ts +0 -2
- package/dist/experimental/swc/module-specifiers.d.ts +0 -2
- package/dist/generator-Y-Ikv4Fu.mjs +0 -1177
- package/dist/generator-css-Bwy_Uz89.mjs +0 -1097
- package/dist/generator-css-CRLrHW4F.js +0 -1124
- package/dist/generator-mmhXzZnv.js +0 -1276
- package/dist/js/syntax.d.ts +0 -10
- package/dist/lightningcss/index.d.ts +0 -8
- package/dist/lightningcss/style-handler/options.d.ts +0 -3
- package/dist/lightningcss/style-handler/selector-transform.d.ts +0 -10
- package/dist/lightningcss/style-handler/selector-utils.d.ts +0 -10
- package/dist/lightningcss/style-handler.d.ts +0 -17
- package/dist/loader-anchors-1MumTAtA.mjs +0 -205
- package/dist/loader-anchors-TrFvT6g1.js +0 -273
- package/dist/logger-BZ45DZJT.js +0 -1003
- package/dist/logger-BoVx1Dbt.mjs +0 -935
- package/dist/patcher-options-6gJN2EXy.js +0 -115
- package/dist/patcher-options-DQfR5xxT.mjs +0 -92
- package/dist/recorder-GdTJ3QqX.js +0 -2878
- package/dist/recorder-XdFvVASS.mjs +0 -2763
- package/dist/tailwindcss/recorder.d.ts +0 -13
- package/dist/tailwindcss/targets/paths.d.ts +0 -13
- package/dist/tailwindcss/targets/record-io.d.ts +0 -5
- package/dist/tailwindcss/targets/recorder.d.ts +0 -3
- package/dist/tailwindcss/targets/types.d.ts +0 -35
- package/dist/types/disabled-options.d.ts +0 -4
- package/dist/vite-BDywuCjn.mjs +0 -2186
- package/dist/vite-DgRh_GXn.js +0 -2199
- package/dist/webpack-CAJR4hhP.js +0 -456
- package/dist/webpack-CiHqVZTg.mjs +0 -441
- package/dist/webpack4.d.ts +0 -4
- package/dist/webpack4.js +0 -387
- package/dist/webpack4.mjs +0 -379
- package/scripts/postinstall.mjs +0 -59
package/dist/presets/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export interface UniAppXOptions {
|
|
|
6
6
|
rem2rpx?: UserDefinedOptions['rem2rpx'];
|
|
7
7
|
generator?: UserDefinedOptions['generator'];
|
|
8
8
|
unitsToPx?: UserDefinedOptions['unitsToPx'];
|
|
9
|
+
unitConversion?: UserDefinedOptions['unitConversion'];
|
|
9
10
|
rawOptions?: UserDefinedOptions;
|
|
10
11
|
resolve?: PackageResolvingOptions;
|
|
11
12
|
customAttributes?: UserDefinedOptions['customAttributes'];
|
package/dist/presets.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_chunk = require("./chunk-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
2
|
+
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
3
|
+
const require_v3_engine = require("./v3-engine-CHItlVq5.js");
|
|
4
|
+
const require_utils = require("./utils-D7Ygohep.js");
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-B-e2RiXr.js");
|
|
6
|
+
require("./logger-TlKT3xmR.js");
|
|
7
|
+
let node_path = require("node:path");
|
|
8
|
+
node_path = require_chunk.__toESM(node_path);
|
|
5
9
|
let node_process = require("node:process");
|
|
6
10
|
node_process = require_chunk.__toESM(node_process);
|
|
7
11
|
let local_pkg = require("local-pkg");
|
|
@@ -15,15 +19,15 @@ function normalizeCssEntries(entries) {
|
|
|
15
19
|
}
|
|
16
20
|
function createBasePreset(options = {}) {
|
|
17
21
|
const { base, cssEntries, resolve, rawOptions, ...userOptions } = options;
|
|
18
|
-
const baseDir =
|
|
22
|
+
const baseDir = require_tailwindcss.resolveTailwindcssBasedir(base);
|
|
19
23
|
const normalizedCssEntries = normalizeCssEntries(cssEntries);
|
|
20
24
|
const tailwindConfig = {
|
|
21
25
|
v2: { cwd: baseDir },
|
|
22
26
|
v3: { cwd: baseDir },
|
|
23
|
-
v4: {
|
|
27
|
+
v4: require_v3_engine.omitUndefined({
|
|
24
28
|
base: baseDir,
|
|
25
29
|
cssEntries: normalizedCssEntries
|
|
26
|
-
}
|
|
30
|
+
})
|
|
27
31
|
};
|
|
28
32
|
if (normalizedCssEntries && normalizedCssEntries.length > 0) tailwindConfig.version = 4;
|
|
29
33
|
const preset = {
|
|
@@ -40,9 +44,14 @@ function createBasePreset(options = {}) {
|
|
|
40
44
|
return (0, _weapp_tailwindcss_shared.defuOverrideArray)((0, _weapp_tailwindcss_shared.defuOverrideArray)(userOptions, rawOptions ?? {}), preset);
|
|
41
45
|
}
|
|
42
46
|
//#endregion
|
|
47
|
+
//#region src/presets/hbuilderx.ts
|
|
48
|
+
function hbuilderx(options = {}) {
|
|
49
|
+
return createBasePreset({ ...options });
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
43
52
|
//#region src/presets/uni-app.ts
|
|
44
53
|
function uniApp(options = {}) {
|
|
45
|
-
const uniPlatform = node_process.default.env
|
|
54
|
+
const uniPlatform = node_process.default.env["UNI_PLATFORM"];
|
|
46
55
|
return createBasePreset({
|
|
47
56
|
disabled: uniPlatform === "h5" || uniPlatform === "app" || uniPlatform === "app-plus" ? true : void 0,
|
|
48
57
|
...options
|
|
@@ -59,7 +68,11 @@ function resolveTailwindResolveOptions(base, resolve) {
|
|
|
59
68
|
const currentPaths = Array.isArray(resolve?.paths) ? resolve.paths : [];
|
|
60
69
|
return {
|
|
61
70
|
...resolve ?? {},
|
|
62
|
-
paths: [...new Set([
|
|
71
|
+
paths: [...new Set([
|
|
72
|
+
node_path.default.join(base, "node_modules"),
|
|
73
|
+
base,
|
|
74
|
+
...currentPaths
|
|
75
|
+
])]
|
|
63
76
|
};
|
|
64
77
|
}
|
|
65
78
|
function resolveInstalledTailwindDefaults(resolve) {
|
|
@@ -79,15 +92,15 @@ function resolveInstalledTailwindDefaults(resolve) {
|
|
|
79
92
|
};
|
|
80
93
|
}
|
|
81
94
|
function uniAppX(options) {
|
|
82
|
-
_weapp_tailwindcss_logger.logger.info(`UNI_PLATFORM: ${node_process.default.env
|
|
95
|
+
_weapp_tailwindcss_logger.logger.info(`UNI_PLATFORM: ${node_process.default.env["UNI_PLATFORM"]}`);
|
|
83
96
|
const utsPlatform = require_utils.resolveUniUtsPlatform();
|
|
84
|
-
const uniPlatform = require_utils.resolveUniUtsPlatform(node_process.default.env
|
|
97
|
+
const uniPlatform = require_utils.resolveUniUtsPlatform(node_process.default.env["UNI_PLATFORM"]);
|
|
85
98
|
_weapp_tailwindcss_logger.logger.info(`UNI_UTS_PLATFORM: ${utsPlatform.raw ?? "undefined"}`);
|
|
86
99
|
const isApp = utsPlatform.isApp || uniPlatform.isApp;
|
|
87
100
|
const cssEntries = normalizeCssEntries(options.cssEntries);
|
|
88
101
|
const resolvedResolve = resolveTailwindResolveOptions(options.base, options.resolve);
|
|
89
102
|
const installedTailwindDefaults = resolveInstalledTailwindDefaults(resolvedResolve);
|
|
90
|
-
const resolvedUniAppX =
|
|
103
|
+
const resolvedUniAppX = require_tailwindcss.resolveUniAppXOptions({
|
|
91
104
|
enabled: isApp,
|
|
92
105
|
componentLocalStyles: options.componentLocalStyles ?? true,
|
|
93
106
|
uvueUnsupported: options.uvueUnsupported,
|
|
@@ -99,6 +112,8 @@ function uniAppX(options) {
|
|
|
99
112
|
...options.generator !== void 0 ? { generator: options.generator } : {},
|
|
100
113
|
rem2rpx: options.rem2rpx,
|
|
101
114
|
unitsToPx: options.unitsToPx,
|
|
115
|
+
unitConversion: options.unitConversion,
|
|
116
|
+
appType: "uni-app-x",
|
|
102
117
|
tailwindcssBasedir: options.base,
|
|
103
118
|
tailwindcssPatcherOptions: {
|
|
104
119
|
projectRoot: options.base,
|
|
@@ -107,10 +122,10 @@ function uniAppX(options) {
|
|
|
107
122
|
cwd: options.base,
|
|
108
123
|
resolve: resolvedResolve,
|
|
109
124
|
v3: { cwd: options.base },
|
|
110
|
-
v4: {
|
|
125
|
+
v4: require_v3_engine.omitUndefined({
|
|
111
126
|
base: options.base,
|
|
112
127
|
cssEntries
|
|
113
|
-
}
|
|
128
|
+
})
|
|
114
129
|
}
|
|
115
130
|
},
|
|
116
131
|
tailwindcss: {
|
|
@@ -124,6 +139,7 @@ function uniAppX(options) {
|
|
|
124
139
|
}
|
|
125
140
|
//#endregion
|
|
126
141
|
exports.createBasePreset = createBasePreset;
|
|
142
|
+
exports.hbuilderx = hbuilderx;
|
|
127
143
|
exports.normalizeCssEntries = normalizeCssEntries;
|
|
128
144
|
exports.uniApp = uniApp;
|
|
129
145
|
exports.uniAppX = uniAppX;
|
package/dist/presets.mjs
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { q as omitUndefined } from "./v3-engine-DcvCCHfs.mjs";
|
|
2
|
+
import { n as defuOverrideArray, o as resolveUniUtsPlatform } from "./utils-DsaS975I.mjs";
|
|
3
|
+
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-C7dJHZ0G.mjs";
|
|
4
|
+
import { t as logger } from "./logger-BNzxZbZj.mjs";
|
|
5
|
+
import path from "node:path";
|
|
3
6
|
import process from "node:process";
|
|
4
7
|
import { getPackageInfoSync } from "local-pkg";
|
|
5
8
|
//#region src/presets/shared.ts
|
|
@@ -15,10 +18,10 @@ function createBasePreset(options = {}) {
|
|
|
15
18
|
const tailwindConfig = {
|
|
16
19
|
v2: { cwd: baseDir },
|
|
17
20
|
v3: { cwd: baseDir },
|
|
18
|
-
v4: {
|
|
21
|
+
v4: omitUndefined({
|
|
19
22
|
base: baseDir,
|
|
20
23
|
cssEntries: normalizedCssEntries
|
|
21
|
-
}
|
|
24
|
+
})
|
|
22
25
|
};
|
|
23
26
|
if (normalizedCssEntries && normalizedCssEntries.length > 0) tailwindConfig.version = 4;
|
|
24
27
|
const preset = {
|
|
@@ -35,9 +38,14 @@ function createBasePreset(options = {}) {
|
|
|
35
38
|
return defuOverrideArray(defuOverrideArray(userOptions, rawOptions ?? {}), preset);
|
|
36
39
|
}
|
|
37
40
|
//#endregion
|
|
41
|
+
//#region src/presets/hbuilderx.ts
|
|
42
|
+
function hbuilderx(options = {}) {
|
|
43
|
+
return createBasePreset({ ...options });
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
38
46
|
//#region src/presets/uni-app.ts
|
|
39
47
|
function uniApp(options = {}) {
|
|
40
|
-
const uniPlatform = process.env
|
|
48
|
+
const uniPlatform = process.env["UNI_PLATFORM"];
|
|
41
49
|
return createBasePreset({
|
|
42
50
|
disabled: uniPlatform === "h5" || uniPlatform === "app" || uniPlatform === "app-plus" ? true : void 0,
|
|
43
51
|
...options
|
|
@@ -54,7 +62,11 @@ function resolveTailwindResolveOptions(base, resolve) {
|
|
|
54
62
|
const currentPaths = Array.isArray(resolve?.paths) ? resolve.paths : [];
|
|
55
63
|
return {
|
|
56
64
|
...resolve ?? {},
|
|
57
|
-
paths: [...new Set([
|
|
65
|
+
paths: [...new Set([
|
|
66
|
+
path.join(base, "node_modules"),
|
|
67
|
+
base,
|
|
68
|
+
...currentPaths
|
|
69
|
+
])]
|
|
58
70
|
};
|
|
59
71
|
}
|
|
60
72
|
function resolveInstalledTailwindDefaults(resolve) {
|
|
@@ -74,9 +86,9 @@ function resolveInstalledTailwindDefaults(resolve) {
|
|
|
74
86
|
};
|
|
75
87
|
}
|
|
76
88
|
function uniAppX(options) {
|
|
77
|
-
logger.info(`UNI_PLATFORM: ${process.env
|
|
89
|
+
logger.info(`UNI_PLATFORM: ${process.env["UNI_PLATFORM"]}`);
|
|
78
90
|
const utsPlatform = resolveUniUtsPlatform();
|
|
79
|
-
const uniPlatform = resolveUniUtsPlatform(process.env
|
|
91
|
+
const uniPlatform = resolveUniUtsPlatform(process.env["UNI_PLATFORM"]);
|
|
80
92
|
logger.info(`UNI_UTS_PLATFORM: ${utsPlatform.raw ?? "undefined"}`);
|
|
81
93
|
const isApp = utsPlatform.isApp || uniPlatform.isApp;
|
|
82
94
|
const cssEntries = normalizeCssEntries(options.cssEntries);
|
|
@@ -94,6 +106,8 @@ function uniAppX(options) {
|
|
|
94
106
|
...options.generator !== void 0 ? { generator: options.generator } : {},
|
|
95
107
|
rem2rpx: options.rem2rpx,
|
|
96
108
|
unitsToPx: options.unitsToPx,
|
|
109
|
+
unitConversion: options.unitConversion,
|
|
110
|
+
appType: "uni-app-x",
|
|
97
111
|
tailwindcssBasedir: options.base,
|
|
98
112
|
tailwindcssPatcherOptions: {
|
|
99
113
|
projectRoot: options.base,
|
|
@@ -102,10 +116,10 @@ function uniAppX(options) {
|
|
|
102
116
|
cwd: options.base,
|
|
103
117
|
resolve: resolvedResolve,
|
|
104
118
|
v3: { cwd: options.base },
|
|
105
|
-
v4: {
|
|
119
|
+
v4: omitUndefined({
|
|
106
120
|
base: options.base,
|
|
107
121
|
cssEntries
|
|
108
|
-
}
|
|
122
|
+
})
|
|
109
123
|
}
|
|
110
124
|
},
|
|
111
125
|
tailwindcss: {
|
|
@@ -118,4 +132,4 @@ function uniAppX(options) {
|
|
|
118
132
|
});
|
|
119
133
|
}
|
|
120
134
|
//#endregion
|
|
121
|
-
export { createBasePreset, normalizeCssEntries, uniApp, uniAppX };
|
|
135
|
+
export { createBasePreset, hbuilderx, normalizeCssEntries, uniApp, uniAppX };
|
package/dist/reset.d.ts
CHANGED
package/dist/reset.js
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_chunk = require("./chunk-
|
|
5
|
+
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
6
6
|
let _weapp_tailwindcss_reset = require("@weapp-tailwindcss/reset");
|
|
7
7
|
_weapp_tailwindcss_reset = require_chunk.__toESM(_weapp_tailwindcss_reset);
|
|
8
8
|
Object.defineProperty(exports, "default", {
|