weapp-tailwindcss 5.0.0-next.3 → 5.0.0-next.5
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 +4 -5
- package/bin/weapp-tailwindcss.js +1 -21
- package/dist/bundlers/shared/generator-css.d.ts +5 -2
- package/dist/bundlers/vite/generate-bundle.d.ts +1 -0
- package/dist/bundlers/vite/index.d.ts +1 -1
- package/dist/bundlers/vite/rewrite-css-imports.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +0 -1
- package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +1 -1
- package/dist/cli/context.d.ts +0 -3
- package/dist/cli/mount-options.d.ts +2 -0
- package/dist/cli.js +8 -2
- package/dist/cli.mjs +8 -2
- package/dist/constants.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/css-macro.d.ts +1 -0
- package/dist/defaults.js +5 -7
- package/dist/defaults.mjs +5 -7
- package/dist/generator/index.d.ts +1 -1
- package/dist/generator/options.d.ts +3 -4
- package/dist/{generator-mmhXzZnv.js → generator-9UEp8OoQ.js} +259 -21
- package/dist/{generator-Y-Ikv4Fu.mjs → generator-Dpp-5s8z.mjs} +260 -22
- package/dist/{generator-css-CRLrHW4F.js → generator-css-CGueCYbX.js} +173 -32
- package/dist/{generator-css-Bwy_Uz89.mjs → generator-css-MyjZhF0z.mjs} +173 -32
- package/dist/generator.js +1 -1
- package/dist/generator.mjs +1 -1
- package/dist/gulp.js +15 -11
- package/dist/gulp.mjs +15 -11
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/js/index.d.ts +1 -0
- package/dist/js/literal-transform.d.ts +2 -0
- package/dist/{logger-BoVx1Dbt.mjs → logger-1gx9UllH.mjs} +21 -51
- package/dist/{logger-BZ45DZJT.js → logger-D9clu_3f.js} +21 -51
- package/dist/patcher-options-DnqazL9E.js +34 -0
- package/dist/patcher-options-GuOwX0-k.mjs +17 -0
- package/dist/postcss.d.ts +2 -2
- package/dist/postcss.js +37 -28
- package/dist/postcss.mjs +37 -28
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/{recorder-XdFvVASS.mjs → recorder-BIW3Kuke.mjs} +5 -12
- package/dist/{recorder-GdTJ3QqX.js → recorder-D4BKt75Q.js} +5 -12
- package/dist/reset.d.ts +1 -0
- package/dist/{css-imports-BbrbluP9.js → run-tasks-Cq5A5nVD.js} +6 -55
- package/dist/{css-imports-CSdPq_Sc.mjs → run-tasks-DUVrDJGl.mjs} +5 -42
- package/dist/tailwindcss/miniprogram.d.ts +5 -1
- package/dist/tailwindcss/patcher-options.d.ts +3 -51
- package/dist/tailwindcss/patcher.d.ts +1 -2
- package/dist/tailwindcss/v4/patcher-options.d.ts +1 -23
- package/dist/tailwindcss/v4/patcher.d.ts +1 -0
- package/dist/tailwindcss/v4-engine/types.d.ts +1 -1
- package/dist/tailwindcss/version.d.ts +4 -0
- package/dist/typedoc.export.d.ts +0 -2
- package/dist/types/index.d.ts +1 -3
- package/dist/types/shared.d.ts +3 -0
- package/dist/types/user-defined-options/general.d.ts +0 -2
- package/dist/types/user-defined-options/important.d.ts +3 -3
- package/dist/utils/disabled.d.ts +2 -3
- package/dist/version-CWBxRFPB.js +56 -0
- package/dist/version-WNz3MwRv.mjs +49 -0
- package/dist/{vite-DgRh_GXn.js → vite-BkMGwDeH.js} +106 -39
- package/dist/{vite-BDywuCjn.mjs → vite-fDM-UQpR.mjs} +89 -22
- 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 +1 -1
- package/dist/{webpack-CAJR4hhP.js → webpack-CICGEKT9.js} +225 -43
- package/dist/{webpack-CiHqVZTg.mjs → webpack-D2Wdk28V.mjs} +214 -27
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +21 -30
- 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/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/loader-anchors-1MumTAtA.mjs +0 -205
- package/dist/loader-anchors-TrFvT6g1.js +0 -273
- package/dist/patcher-options-6gJN2EXy.js +0 -115
- package/dist/patcher-options-DQfR5xxT.mjs +0 -92
- package/dist/types/disabled-options.d.ts +0 -4
- 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/README.md
CHANGED
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
|
|
16
16
|

|
|
17
17
|

|
|
18
|
-

|
|
19
18
|

|
|
20
19
|
[](https://github.com/sonofmagic/weapp-tailwindcss/actions/workflows/test.yml)
|
|
21
20
|
[](https://codecov.io/gh/sonofmagic/weapp-tailwindcss)
|
|
@@ -55,12 +54,12 @@
|
|
|
55
54
|
|
|
56
55
|
## 版本对应
|
|
57
56
|
|
|
58
|
-
目前,`weapp-tailwindcss` 的 `
|
|
57
|
+
目前,`weapp-tailwindcss` 的 `5.x` 版本
|
|
59
58
|
|
|
60
|
-
- 支持最新版本的 `tailwindcss v4` 和 `v3
|
|
61
|
-
- 支持 `webpack5
|
|
59
|
+
- 支持最新版本的 `tailwindcss v4` 和 `v3`。
|
|
60
|
+
- 支持 `webpack5`、`vite`、`rspack`、`rollup`、`rolldown` 和 `gulp` 这些打包工具,也支持纯 `Nodejs` API 的方式,集成到你自己的构建工具中。
|
|
62
61
|
|
|
63
|
-
>
|
|
62
|
+
> `weapp-tailwindcss@5` 面向 Tailwind CSS v3/v4 和现代构建链路,不再内置 Webpack4、PostCSS7、Tailwind CSS v2 兼容入口。`weapp-tailwindcss@5` 需要 `nodejs` 版本 `^20.19.0 || >=22.12.0`,建议安装 `nodejs` 的 `LTS` 版本,详见 [nodejs/release](https://github.com/nodejs/release)
|
|
64
63
|
|
|
65
64
|
## [安装与使用方式](https://tw.icebreaker.top/docs/quick-start/install)
|
|
66
65
|
|
package/bin/weapp-tailwindcss.js
CHANGED
|
@@ -1,28 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
const fs = require('node:fs')
|
|
3
3
|
const path = require('node:path')
|
|
4
|
-
const process = require('node:process')
|
|
5
|
-
|
|
6
|
-
function isInstallLifecycle() {
|
|
7
|
-
return process.env.npm_lifecycle_event === 'postinstall' || process.env.npm_lifecycle_event === 'prepare'
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function isMissingRuntimeModuleError(error) {
|
|
11
|
-
return error && error.code === 'MODULE_NOT_FOUND'
|
|
12
|
-
}
|
|
13
4
|
|
|
14
5
|
const cliPath = path.resolve(__dirname, '../dist/cli.js')
|
|
15
6
|
if (fs.existsSync(cliPath)) {
|
|
16
|
-
|
|
17
|
-
require(cliPath)
|
|
18
|
-
}
|
|
19
|
-
catch (error) {
|
|
20
|
-
if (isInstallLifecycle() && isMissingRuntimeModuleError(error)) {
|
|
21
|
-
console.error('[weapp-tailwindcss] install lifecycle patch skipped because a runtime module is missing.')
|
|
22
|
-
console.error('Run `pnpm --filter weapp-tailwindcss build` before strict CLI validation.')
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
throw error
|
|
26
|
-
}
|
|
27
|
-
}
|
|
7
|
+
require(cliPath)
|
|
28
8
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
2
|
+
import type { NormalizedWeappTailwindcssGeneratorOptions } from '../../generator';
|
|
2
3
|
import type { InternalUserDefinedOptions } from '../../types';
|
|
3
4
|
export interface GenerateCssByGeneratorOptions {
|
|
4
5
|
opts: InternalUserDefinedOptions;
|
|
@@ -17,7 +18,8 @@ export interface GenerateCssByGeneratorOptions {
|
|
|
17
18
|
export interface GenerateCssByGeneratorResult {
|
|
18
19
|
css: string;
|
|
19
20
|
target: string;
|
|
20
|
-
source: 'generator'
|
|
21
|
+
source: 'generator';
|
|
22
|
+
dependencies: string[];
|
|
21
23
|
}
|
|
22
24
|
export declare function createCssAppend(base: string, extra: string): string;
|
|
23
25
|
export declare function splitTailwindV4GeneratedCss(rawSource: string, rawTailwindCss: string): string | undefined;
|
|
@@ -38,6 +40,7 @@ export declare function resolveCssEntrySource(rawSource: string, base: string, o
|
|
|
38
40
|
configRequest: string | undefined;
|
|
39
41
|
base: string;
|
|
40
42
|
} | undefined;
|
|
41
|
-
export declare function resolveGeneratorSource(majorVersion: number | undefined, runtimeState: GenerateCssByGeneratorOptions['runtimeState'], rawSource: string, file: string, cssHandlerOptions: IStyleHandlerOptions): Promise<import("@/generator").TailwindV3ResolvedSource | import("tailwindcss-patch").TailwindV4ResolvedSource>;
|
|
43
|
+
export declare function resolveGeneratorSource(majorVersion: number | undefined, runtimeState: GenerateCssByGeneratorOptions['runtimeState'], rawSource: string, file: string, cssHandlerOptions: IStyleHandlerOptions, generatorOptions?: NormalizedWeappTailwindcssGeneratorOptions): Promise<import("@/generator").TailwindV3ResolvedSource | import("tailwindcss-patch").TailwindV4ResolvedSource>;
|
|
42
44
|
export declare function isPureLocalCssImportWrapper(css: string): boolean;
|
|
45
|
+
export declare function removeTailwindApplyRules(rawSource: string): string;
|
|
43
46
|
export declare function generateCssByGenerator(options: GenerateCssByGeneratorOptions): Promise<GenerateCssByGeneratorResult | undefined>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Plugin } from 'vite';
|
|
2
2
|
import type { UserDefinedOptions } from '../../types';
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function WeappTailwindcss(options?: UserDefinedOptions): Plugin[] | undefined;
|
|
@@ -3,6 +3,7 @@ import type { AppType } from '../../types';
|
|
|
3
3
|
interface RewriteCssImportsOptions {
|
|
4
4
|
appType?: AppType;
|
|
5
5
|
getAppType?: () => AppType | undefined;
|
|
6
|
+
shouldOwnTailwindGeneration?: boolean;
|
|
6
7
|
shouldRewrite: boolean;
|
|
7
8
|
rootImport?: string;
|
|
8
9
|
weappTailwindcssDirPosix: string;
|
|
@@ -7,7 +7,6 @@ interface SetupWebpackV5LoadersOptions {
|
|
|
7
7
|
weappTailwindcssPackageDir: string;
|
|
8
8
|
shouldRewriteCssImports: boolean;
|
|
9
9
|
runtimeLoaderPath?: string;
|
|
10
|
-
runtimeCssImportRewriteLoaderPath?: string;
|
|
11
10
|
getClassSetInLoader: () => Promise<void>;
|
|
12
11
|
getRuntimeWatchDependencies: () => {
|
|
13
12
|
files: ReadonlySet<string>;
|
package/dist/cli/context.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import type { CompatTailwindCssPatchOptions } from '../tailwindcss/patcher-options';
|
|
2
1
|
import type { UserDefinedOptions } from '../types';
|
|
3
|
-
export declare function resolveEntry(entry: string, cwd: string | undefined): string;
|
|
4
|
-
export declare function buildTailwindcssPatcherOptions(overrides: Partial<CompatTailwindCssPatchOptions> | undefined): CompatTailwindCssPatchOptions | undefined;
|
|
5
2
|
export declare function createCliContext(overrides: Partial<UserDefinedOptions> | undefined, resolvedCwd: string | undefined): Required<Omit<UserDefinedOptions, "supportCustomLengthUnitsPatch" | "customReplaceDictionary" | "cache"> & {
|
|
6
3
|
supportCustomLengthUnitsPatch: import("tailwindcss-patch").ILengthUnitsPatchOptions | boolean;
|
|
7
4
|
templateHandler: (rawSource: string, options?: import("@/types").ITemplateHandlerOptions) => Promise<string>;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import type { TailwindcssPatchCliMountOptions } from 'tailwindcss-patch';
|
|
2
|
+
export declare const PATCH_COMMAND_GENERATOR_MODE_NOTICE = "\u63D0\u793A\uFF1Aweapp-tailwindcss@5 \u751F\u6210\u6A21\u5F0F\u4E0D\u518D\u9700\u8981\u6267\u884C weapp-tw patch\uFF0C\u4E5F\u4E0D\u9700\u8981\u5728 package.json \u4E2D\u914D\u7F6E postinstall \u8FD9\u4E2A npm hook\uFF1B\u65E7 CSS \u540E\u5904\u7406\u94FE\u8DEF\u6216\u6392\u969C\u65F6\u518D\u624B\u52A8\u4F7F\u7528\u3002";
|
|
3
|
+
export declare function logPatchCommandGeneratorModeNotice(): void;
|
|
2
4
|
export declare const mountOptions: TailwindcssPatchCliMountOptions;
|
package/dist/cli.js
CHANGED
|
@@ -156,7 +156,7 @@ function getRecordFileCandidates(baseDir) {
|
|
|
156
156
|
}
|
|
157
157
|
//#endregion
|
|
158
158
|
//#region package.json
|
|
159
|
-
var version = "5.0.0-next.
|
|
159
|
+
var version = "5.0.0-next.5";
|
|
160
160
|
//#endregion
|
|
161
161
|
//#region src/constants.ts
|
|
162
162
|
const WEAPP_TW_REQUIRED_NODE_VERSION_RANGE = "^20.19.0 || >=22.12.0";
|
|
@@ -2382,6 +2382,10 @@ async function patchWorkspace(options) {
|
|
|
2382
2382
|
}
|
|
2383
2383
|
//#endregion
|
|
2384
2384
|
//#region src/cli/mount-options.ts
|
|
2385
|
+
const PATCH_COMMAND_GENERATOR_MODE_NOTICE = "提示:weapp-tailwindcss@5 生成模式不再需要执行 weapp-tw patch,也不需要在 package.json 中配置 postinstall 这个 npm hook;旧 CSS 后处理链路或排障时再手动使用。";
|
|
2386
|
+
function logPatchCommandGeneratorModeNotice() {
|
|
2387
|
+
_weapp_tailwindcss_logger.logger.warn(PATCH_COMMAND_GENERATOR_MODE_NOTICE);
|
|
2388
|
+
}
|
|
2385
2389
|
function handleCliError(error) {
|
|
2386
2390
|
if (error instanceof Error) {
|
|
2387
2391
|
_weapp_tailwindcss_logger.logger.error(error.message);
|
|
@@ -2447,7 +2451,9 @@ const mountOptions = {
|
|
|
2447
2451
|
install: withCommandErrorHandling(async (ctx) => {
|
|
2448
2452
|
const shouldClearCache = toBoolean(ctx.args.clearCache, false);
|
|
2449
2453
|
const shouldRecordTarget = toBoolean(ctx.args.recordTarget, true);
|
|
2450
|
-
|
|
2454
|
+
const runWorkspace = toBoolean(ctx.args.workspace, false);
|
|
2455
|
+
logPatchCommandGeneratorModeNotice();
|
|
2456
|
+
if (runWorkspace) {
|
|
2451
2457
|
await patchWorkspace({
|
|
2452
2458
|
cwd: ctx.cwd,
|
|
2453
2459
|
clearCache: shouldClearCache,
|
package/dist/cli.mjs
CHANGED
|
@@ -127,7 +127,7 @@ function getRecordFileCandidates(baseDir) {
|
|
|
127
127
|
}
|
|
128
128
|
//#endregion
|
|
129
129
|
//#region package.json
|
|
130
|
-
var version = "5.0.0-next.
|
|
130
|
+
var version = "5.0.0-next.5";
|
|
131
131
|
//#endregion
|
|
132
132
|
//#region src/constants.ts
|
|
133
133
|
const WEAPP_TW_REQUIRED_NODE_VERSION_RANGE = "^20.19.0 || >=22.12.0";
|
|
@@ -2353,6 +2353,10 @@ async function patchWorkspace(options) {
|
|
|
2353
2353
|
}
|
|
2354
2354
|
//#endregion
|
|
2355
2355
|
//#region src/cli/mount-options.ts
|
|
2356
|
+
const PATCH_COMMAND_GENERATOR_MODE_NOTICE = "提示:weapp-tailwindcss@5 生成模式不再需要执行 weapp-tw patch,也不需要在 package.json 中配置 postinstall 这个 npm hook;旧 CSS 后处理链路或排障时再手动使用。";
|
|
2357
|
+
function logPatchCommandGeneratorModeNotice() {
|
|
2358
|
+
logger$1.warn(PATCH_COMMAND_GENERATOR_MODE_NOTICE);
|
|
2359
|
+
}
|
|
2356
2360
|
function handleCliError(error) {
|
|
2357
2361
|
if (error instanceof Error) {
|
|
2358
2362
|
logger$1.error(error.message);
|
|
@@ -2418,7 +2422,9 @@ const mountOptions = {
|
|
|
2418
2422
|
install: withCommandErrorHandling(async (ctx) => {
|
|
2419
2423
|
const shouldClearCache = toBoolean(ctx.args.clearCache, false);
|
|
2420
2424
|
const shouldRecordTarget = toBoolean(ctx.args.recordTarget, true);
|
|
2421
|
-
|
|
2425
|
+
const runWorkspace = toBoolean(ctx.args.workspace, false);
|
|
2426
|
+
logPatchCommandGeneratorModeNotice();
|
|
2427
|
+
if (runWorkspace) {
|
|
2422
2428
|
await patchWorkspace({
|
|
2423
2429
|
cwd: ctx.cwd,
|
|
2424
2430
|
clearCache: shouldClearCache,
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const runtimeAopLoader = "weapp-tw-runtime-aop-loader";
|
|
2
2
|
export declare const ManglePluginHooks = "ManglePluginHooks";
|
|
3
3
|
export declare const WeappTailwindcssWebpackPluginOptimizeChunkAssetsHooks = "WeappTailwindcssWebpackPluginOptimizeChunkAssetsHooks";
|
|
4
|
-
export declare const pluginName = "weapp-tailwindcss
|
|
4
|
+
export declare const pluginName = "weapp-tailwindcss";
|
|
5
5
|
export declare const vitePluginName = "weapp-tailwindcss:adaptor";
|
|
6
6
|
export declare const WEAPP_TW_REQUIRED_NODE_VERSION = "20.19.0";
|
|
7
7
|
export declare const WEAPP_TW_REQUIRED_NODE_VERSION_RANGE = "^20.19.0 || >=22.12.0";
|
package/dist/core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-8l464Juk.js");
|
|
3
|
-
const require_recorder = require("./recorder-
|
|
3
|
+
const require_recorder = require("./recorder-D4BKt75Q.js");
|
|
4
4
|
let node_process = require("node:process");
|
|
5
5
|
node_process = require_chunk.__toESM(node_process);
|
|
6
6
|
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
package/dist/core.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as ensureRuntimeClassSet, n as shouldSkipJsTransform, r as getCompilerContext, t as setupPatchRecorder } from "./recorder-
|
|
1
|
+
import { g as ensureRuntimeClassSet, n as shouldSkipJsTransform, r as getCompilerContext, t as setupPatchRecorder } from "./recorder-BIW3Kuke.mjs";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import { defuOverrideArray } from "@weapp-tailwindcss/shared";
|
|
4
4
|
//#region src/core.ts
|
package/dist/css-macro.d.ts
CHANGED
package/dist/defaults.js
CHANGED
|
@@ -85,11 +85,13 @@ function getDefaultOptions() {
|
|
|
85
85
|
customAttributes: {},
|
|
86
86
|
customReplaceDictionary: _weapp_core_escape.MappingChars2String,
|
|
87
87
|
appType: void 0,
|
|
88
|
-
arbitraryValues: {
|
|
88
|
+
arbitraryValues: {
|
|
89
|
+
allowDoubleQuotes: false,
|
|
90
|
+
bareArbitraryValues: false
|
|
91
|
+
},
|
|
89
92
|
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
90
93
|
inlineWxs: false,
|
|
91
94
|
injectAdditionalCssVarScope: false,
|
|
92
|
-
rewriteCssImports: true,
|
|
93
95
|
jsPreserveClass: (keyword) => {
|
|
94
96
|
/**
|
|
95
97
|
* 默认保留 keyword
|
|
@@ -97,7 +99,6 @@ function getDefaultOptions() {
|
|
|
97
99
|
if (keyword === "*") return true;
|
|
98
100
|
return false;
|
|
99
101
|
},
|
|
100
|
-
staleClassNameFallback: void 0,
|
|
101
102
|
disabledDefaultTemplateHandler: false,
|
|
102
103
|
cssSelectorReplacement: {
|
|
103
104
|
root: [
|
|
@@ -118,10 +119,7 @@ function getDefaultOptions() {
|
|
|
118
119
|
ignoreCallExpressionIdentifiers: [],
|
|
119
120
|
ignoreTaggedTemplateExpressionIdentifiers: ["weappTwIgnore"],
|
|
120
121
|
replaceRuntimePackages: false,
|
|
121
|
-
generator: {
|
|
122
|
-
mode: "auto",
|
|
123
|
-
target: "weapp"
|
|
124
|
-
},
|
|
122
|
+
generator: { target: "weapp" },
|
|
125
123
|
tailwindcssPatcherOptions: { filter(className) {
|
|
126
124
|
return !(0, _weapp_core_escape.isAllowedClassName)(className);
|
|
127
125
|
} },
|
package/dist/defaults.mjs
CHANGED
|
@@ -82,11 +82,13 @@ function getDefaultOptions() {
|
|
|
82
82
|
customAttributes: {},
|
|
83
83
|
customReplaceDictionary: MappingChars2String,
|
|
84
84
|
appType: void 0,
|
|
85
|
-
arbitraryValues: {
|
|
85
|
+
arbitraryValues: {
|
|
86
|
+
allowDoubleQuotes: false,
|
|
87
|
+
bareArbitraryValues: false
|
|
88
|
+
},
|
|
86
89
|
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
87
90
|
inlineWxs: false,
|
|
88
91
|
injectAdditionalCssVarScope: false,
|
|
89
|
-
rewriteCssImports: true,
|
|
90
92
|
jsPreserveClass: (keyword) => {
|
|
91
93
|
/**
|
|
92
94
|
* 默认保留 keyword
|
|
@@ -94,7 +96,6 @@ function getDefaultOptions() {
|
|
|
94
96
|
if (keyword === "*") return true;
|
|
95
97
|
return false;
|
|
96
98
|
},
|
|
97
|
-
staleClassNameFallback: void 0,
|
|
98
99
|
disabledDefaultTemplateHandler: false,
|
|
99
100
|
cssSelectorReplacement: {
|
|
100
101
|
root: [
|
|
@@ -115,10 +116,7 @@ function getDefaultOptions() {
|
|
|
115
116
|
ignoreCallExpressionIdentifiers: [],
|
|
116
117
|
ignoreTaggedTemplateExpressionIdentifiers: ["weappTwIgnore"],
|
|
117
118
|
replaceRuntimePackages: false,
|
|
118
|
-
generator: {
|
|
119
|
-
mode: "auto",
|
|
120
|
-
target: "weapp"
|
|
121
|
-
},
|
|
119
|
+
generator: { target: "weapp" },
|
|
122
120
|
tailwindcssPatcherOptions: { filter(className) {
|
|
123
121
|
return !isAllowedClassName(className);
|
|
124
122
|
} },
|
|
@@ -7,5 +7,5 @@ export declare function resolveTailwindSourceFromPatcher(patcher: TailwindcssPat
|
|
|
7
7
|
export declare function createWeappTailwindcssGeneratorFromPatcher(patcher: TailwindcssPatcherLike): Promise<WeappTailwindcssGenerator>;
|
|
8
8
|
export { normalizeWeappTailwindcssGeneratorOptions, } from './options';
|
|
9
9
|
export { resolveTailwindV3Source, resolveTailwindV3SourceFromPatcher, resolveTailwindV3SourceOptionsFromPatcher, resolveTailwindV4Source, resolveTailwindV4SourceFromPatcher, resolveTailwindV4SourceFromPatchOptions, resolveTailwindV4SourceOptionsFromPatcher, transformTailwindV3CssByTarget, transformTailwindV3CssToWeapp, transformTailwindV4CssByTarget, transformTailwindV4CssToWeapp, };
|
|
10
|
-
export type { NormalizedWeappTailwindcssGeneratorOptions,
|
|
10
|
+
export type { NormalizedWeappTailwindcssGeneratorOptions, WeappTailwindcssGeneratorOptions, WeappTailwindcssGeneratorUserOptions, } from './options';
|
|
11
11
|
export type { TailwindCandidateSource, TailwindGeneratorVersion, TailwindResolvedSource, TailwindV3CandidateSource, TailwindV3Engine, TailwindV3GenerateOptions, TailwindV3GenerateResult, TailwindV3GenerateTarget, TailwindV3ResolvedSource, TailwindV3SourceOptions, TailwindV4CandidateSource, TailwindV4DesignSystem, TailwindV4Engine, TailwindV4GenerateOptions, TailwindV4GenerateResult, TailwindV4GenerateTarget, TailwindV4ResolvedSource, TailwindV4SourceOptions, WeappTailwindcssGenerateOptions, WeappTailwindcssGenerateResult, WeappTailwindcssGenerator, WeappTailwindcssGeneratorTarget, } from './types';
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
2
2
|
import type { WeappTailwindcssGeneratorTarget } from './types';
|
|
3
|
-
export type WeappTailwindcssGeneratorMode = 'auto' | 'force' | 'off';
|
|
4
3
|
export interface WeappTailwindcssGeneratorOptions {
|
|
5
|
-
mode?: WeappTailwindcssGeneratorMode;
|
|
6
4
|
target?: WeappTailwindcssGeneratorTarget;
|
|
5
|
+
config?: string;
|
|
7
6
|
styleOptions?: Partial<IStyleHandlerOptions>;
|
|
8
7
|
tailwindcssV3Compatibility?: boolean;
|
|
9
8
|
}
|
|
10
|
-
export type WeappTailwindcssGeneratorUserOptions =
|
|
9
|
+
export type WeappTailwindcssGeneratorUserOptions = WeappTailwindcssGeneratorOptions;
|
|
11
10
|
export interface NormalizedWeappTailwindcssGeneratorOptions {
|
|
12
|
-
mode: WeappTailwindcssGeneratorMode;
|
|
13
11
|
target: WeappTailwindcssGeneratorTarget;
|
|
12
|
+
config?: string;
|
|
14
13
|
styleOptions?: Partial<IStyleHandlerOptions>;
|
|
15
14
|
tailwindcssV3Compatibility: boolean;
|
|
16
15
|
}
|