weapp-tailwindcss 3.4.0 → 3.5.0-alpha.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.
Files changed (50) hide show
  1. package/dist/babel/index.d.ts +2 -13
  2. package/dist/bundlers/gulp/index.d.ts +1 -2
  3. package/dist/bundlers/vite/index.d.ts +1 -1
  4. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4.d.ts +1 -1
  5. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +1 -1
  6. package/dist/cache/index.d.ts +0 -1
  7. package/dist/cli.js +11 -11
  8. package/dist/cli.mjs +11 -11
  9. package/dist/core.d.ts +3 -3
  10. package/dist/core.js +23 -30
  11. package/dist/core.mjs +22 -29
  12. package/dist/css-macro/index.d.ts +1 -1
  13. package/dist/gulp.js +13 -13
  14. package/dist/gulp.mjs +13 -13
  15. package/dist/{index-B5NiRecR.js → index-B8Pxc74h.js} +7 -7
  16. package/dist/{index-DwZHOkK3.js → index-CCbEWRGc.js} +3 -1
  17. package/dist/{index-B2TNoaOv.mjs → index-ClzClhjc.mjs} +4 -4
  18. package/dist/{index-DmzxhHCX.js → index-Ddev8wez.js} +4 -4
  19. package/dist/{index-DeW_zXzo.mjs → index-rwuSO4cM.mjs} +7 -7
  20. package/dist/{index-BPzIdybK.mjs → index-szMvMylQ.mjs} +3 -1
  21. package/dist/index.js +15 -15
  22. package/dist/index.mjs +15 -15
  23. package/dist/js/handlers.d.ts +1 -1
  24. package/dist/js/index.d.ts +1 -1
  25. package/dist/mangle/index.d.ts +2 -2
  26. package/dist/{options-7EjuAISl.mjs → options-BT2K7ro6.mjs} +190 -189
  27. package/dist/{options-C-rvBixk.js → options-BjD225Hm.js} +192 -191
  28. package/dist/postcss/index.d.ts +4 -3
  29. package/dist/postcss/mp.d.ts +1 -1
  30. package/dist/postcss/plugins/index.d.ts +1 -1
  31. package/dist/postcss/plugins/post.d.ts +1 -1
  32. package/dist/postcss/plugins/pre.d.ts +1 -1
  33. package/dist/postcss/preflight.d.ts +1 -1
  34. package/dist/postcss/selectorParser.d.ts +1 -1
  35. package/dist/postcss/shared.d.ts +1 -1
  36. package/dist/postcss.js +1 -1
  37. package/dist/postcss.mjs +1 -1
  38. package/dist/types.d.ts +4 -4
  39. package/dist/utils.d.ts +3 -3
  40. package/dist/{v5-Ch6783yy.js → v5-_VYyLdJC.js} +3 -3
  41. package/dist/{v5-BD9-sqra.mjs → v5-vdra_05U.mjs} +3 -3
  42. package/dist/vite.js +13 -13
  43. package/dist/vite.mjs +13 -13
  44. package/dist/webpack.js +13 -13
  45. package/dist/webpack.mjs +13 -13
  46. package/dist/webpack4.js +11 -11
  47. package/dist/webpack4.mjs +11 -11
  48. package/dist/wxml/shared.d.ts +1 -1
  49. package/dist/wxml/utils.d.ts +3 -3
  50. package/package.json +11 -12
@@ -1,16 +1,5 @@
1
1
  import _babelGenerate from '@babel/generator';
2
+ import _babelTraverse from '@babel/traverse';
2
3
  export { parse, parseExpression } from '@babel/parser';
3
4
  export declare const generate: typeof _babelGenerate;
4
- export declare const traverse: {
5
- <S>(parent: import("@babel/types").Node, opts: import("@babel/traverse").TraverseOptions<S>, scope: import("@babel/traverse").Scope | undefined, state: S, parentPath?: import("@babel/traverse").NodePath<import("@babel/types").Node> | undefined): void;
6
- (parent: import("@babel/types").Node, opts?: import("@babel/traverse").TraverseOptions<import("@babel/types").Node> | undefined, scope?: import("@babel/traverse").Scope | undefined, state?: any, parentPath?: import("@babel/traverse").NodePath<import("@babel/types").Node> | undefined): void;
7
- visitors: typeof import("@babel/traverse").visitors;
8
- verify: typeof import("@babel/traverse").visitors.verify;
9
- explode: typeof import("@babel/traverse").visitors.explode;
10
- cheap: (node: import("@babel/types").Node, enter: (node: import("@babel/types").Node) => void) => void;
11
- node: (node: import("@babel/types").Node, opts: import("@babel/traverse").TraverseOptions<import("@babel/types").Node>, scope?: import("@babel/traverse").Scope | undefined, state?: any, path?: import("@babel/traverse").NodePath<import("@babel/types").Node> | undefined, skipKeys?: Record<string, boolean> | undefined) => void;
12
- clearNode: (node: import("@babel/types").Node, opts?: import("@babel/types").RemovePropertiesOptions | undefined) => void;
13
- removeProperties: (tree: import("@babel/types").Node, opts?: import("@babel/types").RemovePropertiesOptions | undefined) => import("@babel/types").Node;
14
- hasType: (tree: import("@babel/types").Node, type: "AnyTypeAnnotation" | "ArgumentPlaceholder" | "ArrayExpression" | "ArrayPattern" | "ArrayTypeAnnotation" | "ArrowFunctionExpression" | "AssignmentExpression" | "AssignmentPattern" | "AwaitExpression" | "BigIntLiteral" | "BinaryExpression" | "BindExpression" | "BlockStatement" | "BooleanLiteral" | "BooleanLiteralTypeAnnotation" | "BooleanTypeAnnotation" | "BreakStatement" | "CallExpression" | "CatchClause" | "ClassAccessorProperty" | "ClassBody" | "ClassDeclaration" | "ClassExpression" | "ClassImplements" | "ClassMethod" | "ClassPrivateMethod" | "ClassPrivateProperty" | "ClassProperty" | "ConditionalExpression" | "ContinueStatement" | "DebuggerStatement" | "DecimalLiteral" | "DeclareClass" | "DeclareExportAllDeclaration" | "DeclareExportDeclaration" | "DeclareFunction" | "DeclareInterface" | "DeclareModule" | "DeclareModuleExports" | "DeclareOpaqueType" | "DeclareTypeAlias" | "DeclareVariable" | "DeclaredPredicate" | "Decorator" | "Directive" | "DirectiveLiteral" | "DoExpression" | "DoWhileStatement" | "EmptyStatement" | "EmptyTypeAnnotation" | "EnumBooleanBody" | "EnumBooleanMember" | "EnumDeclaration" | "EnumDefaultedMember" | "EnumNumberBody" | "EnumNumberMember" | "EnumStringBody" | "EnumStringMember" | "EnumSymbolBody" | "ExistsTypeAnnotation" | "ExportAllDeclaration" | "ExportDefaultDeclaration" | "ExportDefaultSpecifier" | "ExportNamedDeclaration" | "ExportNamespaceSpecifier" | "ExportSpecifier" | "ExpressionStatement" | "File" | "ForInStatement" | "ForOfStatement" | "ForStatement" | "FunctionDeclaration" | "FunctionExpression" | "FunctionTypeAnnotation" | "FunctionTypeParam" | "GenericTypeAnnotation" | "Identifier" | "IfStatement" | "Import" | "ImportAttribute" | "ImportDeclaration" | "ImportDefaultSpecifier" | "ImportExpression" | "ImportNamespaceSpecifier" | "ImportSpecifier" | "IndexedAccessType" | "InferredPredicate" | "InterfaceDeclaration" | "InterfaceExtends" | "InterfaceTypeAnnotation" | "InterpreterDirective" | "IntersectionTypeAnnotation" | "JSXAttribute" | "JSXClosingElement" | "JSXClosingFragment" | "JSXElement" | "JSXEmptyExpression" | "JSXExpressionContainer" | "JSXFragment" | "JSXIdentifier" | "JSXMemberExpression" | "JSXNamespacedName" | "JSXOpeningElement" | "JSXOpeningFragment" | "JSXSpreadAttribute" | "JSXSpreadChild" | "JSXText" | "LabeledStatement" | "LogicalExpression" | "MemberExpression" | "MetaProperty" | "MixedTypeAnnotation" | "ModuleExpression" | "NewExpression" | "Noop" | "NullLiteral" | "NullLiteralTypeAnnotation" | "NullableTypeAnnotation" | "NumberLiteral" | "NumberLiteralTypeAnnotation" | "NumberTypeAnnotation" | "NumericLiteral" | "ObjectExpression" | "ObjectMethod" | "ObjectPattern" | "ObjectProperty" | "ObjectTypeAnnotation" | "ObjectTypeCallProperty" | "ObjectTypeIndexer" | "ObjectTypeInternalSlot" | "ObjectTypeProperty" | "ObjectTypeSpreadProperty" | "OpaqueType" | "OptionalCallExpression" | "OptionalIndexedAccessType" | "OptionalMemberExpression" | "ParenthesizedExpression" | "PipelineBareFunction" | "PipelinePrimaryTopicReference" | "PipelineTopicExpression" | "Placeholder" | "PrivateName" | "Program" | "QualifiedTypeIdentifier" | "RecordExpression" | "RegExpLiteral" | "RegexLiteral" | "RestElement" | "RestProperty" | "ReturnStatement" | "SequenceExpression" | "SpreadElement" | "SpreadProperty" | "StaticBlock" | "StringLiteral" | "StringLiteralTypeAnnotation" | "StringTypeAnnotation" | "Super" | "SwitchCase" | "SwitchStatement" | "SymbolTypeAnnotation" | "TSAnyKeyword" | "TSArrayType" | "TSAsExpression" | "TSBigIntKeyword" | "TSBooleanKeyword" | "TSCallSignatureDeclaration" | "TSConditionalType" | "TSConstructSignatureDeclaration" | "TSConstructorType" | "TSDeclareFunction" | "TSDeclareMethod" | "TSEnumDeclaration" | "TSEnumMember" | "TSExportAssignment" | "TSExpressionWithTypeArguments" | "TSExternalModuleReference" | "TSFunctionType" | "TSImportEqualsDeclaration" | "TSImportType" | "TSIndexSignature" | "TSIndexedAccessType" | "TSInferType" | "TSInstantiationExpression" | "TSInterfaceBody" | "TSInterfaceDeclaration" | "TSIntersectionType" | "TSIntrinsicKeyword" | "TSLiteralType" | "TSMappedType" | "TSMethodSignature" | "TSModuleBlock" | "TSModuleDeclaration" | "TSNamedTupleMember" | "TSNamespaceExportDeclaration" | "TSNeverKeyword" | "TSNonNullExpression" | "TSNullKeyword" | "TSNumberKeyword" | "TSObjectKeyword" | "TSOptionalType" | "TSParameterProperty" | "TSParenthesizedType" | "TSPropertySignature" | "TSQualifiedName" | "TSRestType" | "TSSatisfiesExpression" | "TSStringKeyword" | "TSSymbolKeyword" | "TSThisType" | "TSTupleType" | "TSTypeAliasDeclaration" | "TSTypeAnnotation" | "TSTypeAssertion" | "TSTypeLiteral" | "TSTypeOperator" | "TSTypeParameter" | "TSTypeParameterDeclaration" | "TSTypeParameterInstantiation" | "TSTypePredicate" | "TSTypeQuery" | "TSTypeReference" | "TSUndefinedKeyword" | "TSUnionType" | "TSUnknownKeyword" | "TSVoidKeyword" | "TaggedTemplateExpression" | "TemplateElement" | "TemplateLiteral" | "ThisExpression" | "ThisTypeAnnotation" | "ThrowStatement" | "TopicReference" | "TryStatement" | "TupleExpression" | "TupleTypeAnnotation" | "TypeAlias" | "TypeAnnotation" | "TypeCastExpression" | "TypeParameter" | "TypeParameterDeclaration" | "TypeParameterInstantiation" | "TypeofTypeAnnotation" | "UnaryExpression" | "UnionTypeAnnotation" | "UpdateExpression" | "V8IntrinsicIdentifier" | "VariableDeclaration" | "VariableDeclarator" | "Variance" | "VoidTypeAnnotation" | "WhileStatement" | "WithStatement" | "YieldExpression", denylistTypes?: string[] | undefined) => boolean;
15
- cache: typeof import("@babel/traverse").cache;
16
- };
5
+ export declare const traverse: typeof _babelTraverse;
@@ -1,6 +1,5 @@
1
- /// <reference types="node" />
2
1
  import stream from 'node:stream';
3
- import type { CreateJsHandlerOptions, IStyleHandlerOptions, ITemplateHandlerOptions, UserDefinedOptions } from "../../types";
2
+ import type { CreateJsHandlerOptions, IStyleHandlerOptions, ITemplateHandlerOptions, UserDefinedOptions } from '../../types';
4
3
  export declare function createPlugins(options?: UserDefinedOptions): {
5
4
  transformWxss: (options?: Partial<IStyleHandlerOptions>) => stream.Transform;
6
5
  transformWxml: (options?: Partial<ITemplateHandlerOptions>) => stream.Transform;
@@ -1,3 +1,3 @@
1
1
  import type { Plugin } from 'vite';
2
- import type { UserDefinedOptions } from "../../types";
2
+ import type { UserDefinedOptions } from '../../types';
3
3
  export declare function UnifiedViteWeappTailwindcssPlugin(options?: UserDefinedOptions): Plugin | undefined;
@@ -1,5 +1,5 @@
1
1
  import type { Compiler } from 'webpack4';
2
- import type { AppType, IBaseWebpackPlugin, InternalUserDefinedOptions, UserDefinedOptions } from "../../../types";
2
+ import type { AppType, IBaseWebpackPlugin, InternalUserDefinedOptions, UserDefinedOptions } from '../../../types';
3
3
  export declare class UnifiedWebpackPluginV4 implements IBaseWebpackPlugin {
4
4
  options: InternalUserDefinedOptions;
5
5
  appType?: AppType;
@@ -1,5 +1,5 @@
1
1
  import type { Compiler } from 'webpack';
2
- import type { AppType, IBaseWebpackPlugin, InternalUserDefinedOptions, UserDefinedOptions } from "../../../types";
2
+ import type { AppType, IBaseWebpackPlugin, InternalUserDefinedOptions, UserDefinedOptions } from '../../../types';
3
3
  export declare class UnifiedWebpackPluginV5 implements IBaseWebpackPlugin {
4
4
  options: InternalUserDefinedOptions;
5
5
  appType?: AppType;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { Buffer } from 'node:buffer';
3
2
  import { LRUCache } from 'lru-cache';
4
3
  import type { sources } from 'webpack';
package/dist/cli.js CHANGED
@@ -2,27 +2,27 @@
2
2
 
3
3
  var process = require('node:process');
4
4
  var semver = require('semver');
5
- var options = require('./options-C-rvBixk.js');
6
- var index = require('./index-DwZHOkK3.js');
5
+ var options = require('./options-BjD225Hm.js');
6
+ var index = require('./index-CCbEWRGc.js');
7
7
  require('magic-string');
8
- require('./replace.js');
9
- require('@weapp-core/escape');
10
- require('@ast-core/escape');
11
- require('./shared-hzYeE1wX.js');
12
- require('@weapp-core/regex');
13
8
  require('@babel/generator');
14
9
  require('@babel/traverse');
15
10
  require('@babel/parser');
11
+ require('@weapp-core/escape');
12
+ require('@ast-core/escape');
16
13
  require('./defaults-DW-EahCC.js');
17
14
  require('./defu-Cdz2PomB.js');
15
+ require('./replace.js');
16
+ require('./shared-hzYeE1wX.js');
17
+ require('@weapp-core/regex');
18
+ require('@tailwindcss-mangle/shared');
19
+ require('lru-cache');
20
+ require('md5');
21
+ require('postcss');
18
22
  require('@babel/types');
19
23
  require('htmlparser2');
20
- require('postcss');
21
24
  require('node:path');
22
25
  require('tailwindcss-patch');
23
- require('@tailwindcss-mangle/shared');
24
- require('lru-cache');
25
- require('md5');
26
26
  require('@csstools/postcss-is-pseudo-class');
27
27
  require('postcss-rem-to-responsive-pixel');
28
28
  require('postcss-selector-parser');
package/dist/cli.mjs CHANGED
@@ -1,26 +1,26 @@
1
1
  import process from 'node:process';
2
2
  import semver from 'semver';
3
- import { g as getOptions } from './options-7EjuAISl.mjs';
4
- import { W as WEAPP_TW_REQUIRED_NODE_VERSION } from './index-BPzIdybK.mjs';
3
+ import { g as getOptions } from './options-BT2K7ro6.mjs';
4
+ import { W as WEAPP_TW_REQUIRED_NODE_VERSION } from './index-szMvMylQ.mjs';
5
5
  import 'magic-string';
6
- import './replace.mjs';
7
- import '@weapp-core/escape';
8
- import '@ast-core/escape';
9
- import './shared-DbJl6i6a.mjs';
10
- import '@weapp-core/regex';
11
6
  import '@babel/generator';
12
7
  import '@babel/traverse';
13
8
  import '@babel/parser';
9
+ import '@weapp-core/escape';
10
+ import '@ast-core/escape';
14
11
  import './defaults-w3rlKQwe.mjs';
15
12
  import './defu-n46TJT6t.mjs';
13
+ import './replace.mjs';
14
+ import './shared-DbJl6i6a.mjs';
15
+ import '@weapp-core/regex';
16
+ import '@tailwindcss-mangle/shared';
17
+ import 'lru-cache';
18
+ import 'md5';
19
+ import 'postcss';
16
20
  import '@babel/types';
17
21
  import 'htmlparser2';
18
- import 'postcss';
19
22
  import 'node:path';
20
23
  import 'tailwindcss-patch';
21
- import '@tailwindcss-mangle/shared';
22
- import 'lru-cache';
23
- import 'md5';
24
24
  import '@csstools/postcss-is-pseudo-class';
25
25
  import 'postcss-rem-to-responsive-pixel';
26
26
  import 'postcss-selector-parser';
package/dist/core.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import type { CreateJsHandlerOptions, IStyleHandlerOptions, ITemplateHandlerOptions, UserDefinedOptions } from "./types";
1
+ import type { CreateJsHandlerOptions, IStyleHandlerOptions, ITemplateHandlerOptions, UserDefinedOptions } from './types';
2
2
  export declare function createContext(options?: UserDefinedOptions): {
3
- transformWxss: (rawCss: string, options?: Partial<IStyleHandlerOptions>) => Promise<string>;
3
+ transformWxss: (rawCss: string, options?: Partial<IStyleHandlerOptions>) => Promise<import("postcss").Result<import("postcss").Document | import("postcss").Root>>;
4
4
  transformWxml: (rawWxml: string, options?: ITemplateHandlerOptions) => Promise<string>;
5
5
  transformJs: (rawJs: string, options?: {
6
6
  runtimeSet?: Set<string>;
7
- } & CreateJsHandlerOptions) => Promise<string>;
7
+ } & CreateJsHandlerOptions) => import("./types").JsHandlerResult | Promise<import("./types").JsHandlerResult>;
8
8
  };
package/dist/core.js CHANGED
@@ -2,60 +2,53 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var options = require('./options-C-rvBixk.js');
5
+ var options = require('./options-BjD225Hm.js');
6
6
  require('magic-string');
7
- require('./replace.js');
8
- require('@weapp-core/escape');
9
- require('@ast-core/escape');
10
- require('./shared-hzYeE1wX.js');
11
- require('@weapp-core/regex');
12
7
  require('@babel/generator');
13
8
  require('@babel/traverse');
14
9
  require('@babel/parser');
10
+ require('@weapp-core/escape');
11
+ require('@ast-core/escape');
15
12
  require('./defaults-DW-EahCC.js');
16
13
  require('./defu-Cdz2PomB.js');
17
- require('@babel/types');
18
- require('htmlparser2');
14
+ require('./replace.js');
15
+ require('./shared-hzYeE1wX.js');
16
+ require('@weapp-core/regex');
17
+ require('@tailwindcss-mangle/shared');
18
+ require('lru-cache');
19
+ require('md5');
19
20
  require('postcss');
20
- require('./index-DwZHOkK3.js');
21
+ require('./index-CCbEWRGc.js');
21
22
  require('@csstools/postcss-is-pseudo-class');
22
23
  require('postcss-rem-to-responsive-pixel');
23
24
  require('postcss-selector-parser');
25
+ require('@babel/types');
26
+ require('htmlparser2');
24
27
  require('node:path');
25
28
  require('node:process');
26
29
  require('tailwindcss-patch');
27
- require('@tailwindcss-mangle/shared');
28
- require('lru-cache');
29
- require('md5');
30
30
 
31
31
  function createContext(options$1 = {}) {
32
32
  const opts = options.getOptions(options$1);
33
33
  const { templateHandler, styleHandler, patch, jsHandler, twPatcher } = opts;
34
34
  let runtimeSet = new Set();
35
35
  patch === null || patch === void 0 ? void 0 : patch();
36
- function transformWxss(rawCss, options$1) {
37
- return options.__awaiter(this, void 0, void 0, function* () {
38
- const code = yield styleHandler(rawCss, Object.assign({
39
- isMainChunk: true,
40
- }, options$1));
41
- return code;
42
- });
36
+ function transformWxss(rawCss, options) {
37
+ return styleHandler(rawCss, Object.assign({
38
+ isMainChunk: true,
39
+ }, options));
43
40
  }
44
- function transformJs(rawJs_1) {
45
- return options.__awaiter(this, arguments, void 0, function* (rawJs, options = {}) {
46
- runtimeSet
47
- = options && options.runtimeSet
48
- ? options.runtimeSet
49
- : twPatcher.getClassSet();
50
- const { code } = yield jsHandler(rawJs, runtimeSet, options);
51
- return code;
52
- });
41
+ function transformJs(rawJs, options = {}) {
42
+ runtimeSet
43
+ = options && options.runtimeSet
44
+ ? options.runtimeSet
45
+ : twPatcher.getClassSet();
46
+ return jsHandler(rawJs, runtimeSet, options);
53
47
  }
54
48
  function transformWxml(rawWxml, options) {
55
- const code = templateHandler(rawWxml, Object.assign({
49
+ return templateHandler(rawWxml, Object.assign({
56
50
  runtimeSet,
57
51
  }, options));
58
- return code;
59
52
  }
60
53
  return {
61
54
  transformWxss,
package/dist/core.mjs CHANGED
@@ -1,28 +1,28 @@
1
- import { g as getOptions, _ as __awaiter } from './options-7EjuAISl.mjs';
1
+ import { g as getOptions } from './options-BT2K7ro6.mjs';
2
2
  import 'magic-string';
3
- import './replace.mjs';
4
- import '@weapp-core/escape';
5
- import '@ast-core/escape';
6
- import './shared-DbJl6i6a.mjs';
7
- import '@weapp-core/regex';
8
3
  import '@babel/generator';
9
4
  import '@babel/traverse';
10
5
  import '@babel/parser';
6
+ import '@weapp-core/escape';
7
+ import '@ast-core/escape';
11
8
  import './defaults-w3rlKQwe.mjs';
12
9
  import './defu-n46TJT6t.mjs';
13
- import '@babel/types';
14
- import 'htmlparser2';
10
+ import './replace.mjs';
11
+ import './shared-DbJl6i6a.mjs';
12
+ import '@weapp-core/regex';
13
+ import '@tailwindcss-mangle/shared';
14
+ import 'lru-cache';
15
+ import 'md5';
15
16
  import 'postcss';
16
- import './index-BPzIdybK.mjs';
17
+ import './index-szMvMylQ.mjs';
17
18
  import '@csstools/postcss-is-pseudo-class';
18
19
  import 'postcss-rem-to-responsive-pixel';
19
20
  import 'postcss-selector-parser';
21
+ import '@babel/types';
22
+ import 'htmlparser2';
20
23
  import 'node:path';
21
24
  import 'node:process';
22
25
  import 'tailwindcss-patch';
23
- import '@tailwindcss-mangle/shared';
24
- import 'lru-cache';
25
- import 'md5';
26
26
 
27
27
  function createContext(options = {}) {
28
28
  const opts = getOptions(options);
@@ -30,28 +30,21 @@ function createContext(options = {}) {
30
30
  let runtimeSet = new Set();
31
31
  patch === null || patch === void 0 ? void 0 : patch();
32
32
  function transformWxss(rawCss, options) {
33
- return __awaiter(this, void 0, void 0, function* () {
34
- const code = yield styleHandler(rawCss, Object.assign({
35
- isMainChunk: true,
36
- }, options));
37
- return code;
38
- });
33
+ return styleHandler(rawCss, Object.assign({
34
+ isMainChunk: true,
35
+ }, options));
39
36
  }
40
- function transformJs(rawJs_1) {
41
- return __awaiter(this, arguments, void 0, function* (rawJs, options = {}) {
42
- runtimeSet
43
- = options && options.runtimeSet
44
- ? options.runtimeSet
45
- : twPatcher.getClassSet();
46
- const { code } = yield jsHandler(rawJs, runtimeSet, options);
47
- return code;
48
- });
37
+ function transformJs(rawJs, options = {}) {
38
+ runtimeSet
39
+ = options && options.runtimeSet
40
+ ? options.runtimeSet
41
+ : twPatcher.getClassSet();
42
+ return jsHandler(rawJs, runtimeSet, options);
49
43
  }
50
44
  function transformWxml(rawWxml, options) {
51
- const code = templateHandler(rawWxml, Object.assign({
45
+ return templateHandler(rawWxml, Object.assign({
52
46
  runtimeSet,
53
47
  }, options));
54
- return code;
55
48
  }
56
49
  return {
57
50
  transformWxss,
@@ -8,7 +8,7 @@ export interface Options {
8
8
  declare const _default: {
9
9
  (options: Options): {
10
10
  handler: import("tailwindcss/types/config").PluginCreator;
11
- config?: Partial<import("tailwindcss/types/config").Config> | undefined;
11
+ config?: Partial<import("tailwindcss/types/config").Config>;
12
12
  };
13
13
  __isOptionsFunction: true;
14
14
  };
package/dist/gulp.js CHANGED
@@ -2,32 +2,32 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-B5NiRecR.js');
6
- require('./options-C-rvBixk.js');
5
+ var index = require('./index-B8Pxc74h.js');
6
+ require('./options-BjD225Hm.js');
7
7
  require('magic-string');
8
- require('./replace.js');
9
- require('@weapp-core/escape');
10
- require('@ast-core/escape');
11
- require('./shared-hzYeE1wX.js');
12
- require('@weapp-core/regex');
13
8
  require('@babel/generator');
14
9
  require('@babel/traverse');
15
10
  require('@babel/parser');
11
+ require('@weapp-core/escape');
12
+ require('@ast-core/escape');
16
13
  require('./defaults-DW-EahCC.js');
17
14
  require('./defu-Cdz2PomB.js');
18
- require('@babel/types');
19
- require('htmlparser2');
15
+ require('./replace.js');
16
+ require('./shared-hzYeE1wX.js');
17
+ require('@weapp-core/regex');
18
+ require('@tailwindcss-mangle/shared');
19
+ require('lru-cache');
20
+ require('md5');
20
21
  require('postcss');
21
- require('./index-DwZHOkK3.js');
22
+ require('./index-CCbEWRGc.js');
22
23
  require('@csstools/postcss-is-pseudo-class');
23
24
  require('postcss-rem-to-responsive-pixel');
24
25
  require('postcss-selector-parser');
26
+ require('@babel/types');
27
+ require('htmlparser2');
25
28
  require('node:path');
26
29
  require('node:process');
27
30
  require('tailwindcss-patch');
28
- require('@tailwindcss-mangle/shared');
29
- require('lru-cache');
30
- require('md5');
31
31
  require('node:stream');
32
32
  require('node:buffer');
33
33
  require('./index-HC-Qkn0i.js');
package/dist/gulp.mjs CHANGED
@@ -1,29 +1,29 @@
1
- export { c as createPlugins } from './index-DeW_zXzo.mjs';
2
- import './options-7EjuAISl.mjs';
1
+ export { c as createPlugins } from './index-rwuSO4cM.mjs';
2
+ import './options-BT2K7ro6.mjs';
3
3
  import 'magic-string';
4
- import './replace.mjs';
5
- import '@weapp-core/escape';
6
- import '@ast-core/escape';
7
- import './shared-DbJl6i6a.mjs';
8
- import '@weapp-core/regex';
9
4
  import '@babel/generator';
10
5
  import '@babel/traverse';
11
6
  import '@babel/parser';
7
+ import '@weapp-core/escape';
8
+ import '@ast-core/escape';
12
9
  import './defaults-w3rlKQwe.mjs';
13
10
  import './defu-n46TJT6t.mjs';
14
- import '@babel/types';
15
- import 'htmlparser2';
11
+ import './replace.mjs';
12
+ import './shared-DbJl6i6a.mjs';
13
+ import '@weapp-core/regex';
14
+ import '@tailwindcss-mangle/shared';
15
+ import 'lru-cache';
16
+ import 'md5';
16
17
  import 'postcss';
17
- import './index-BPzIdybK.mjs';
18
+ import './index-szMvMylQ.mjs';
18
19
  import '@csstools/postcss-is-pseudo-class';
19
20
  import 'postcss-rem-to-responsive-pixel';
20
21
  import 'postcss-selector-parser';
22
+ import '@babel/types';
23
+ import 'htmlparser2';
21
24
  import 'node:path';
22
25
  import 'node:process';
23
26
  import 'tailwindcss-patch';
24
- import '@tailwindcss-mangle/shared';
25
- import 'lru-cache';
26
- import 'md5';
27
27
  import 'node:stream';
28
28
  import 'node:buffer';
29
29
  import './index-BEIjgKpF.mjs';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var options = require('./options-C-rvBixk.js');
3
+ var options = require('./options-BjD225Hm.js');
4
4
  var stream = require('node:stream');
5
5
  var node_buffer = require('node:buffer');
6
6
  var index = require('./index-HC-Qkn0i.js');
@@ -19,7 +19,7 @@ function createPlugins(options$1 = {}) {
19
19
  function transformWxss(options$1 = {}) {
20
20
  return new Transform({
21
21
  objectMode: true,
22
- transform(file, encoding, callback) {
22
+ transform(file, _encoding, callback) {
23
23
  return options.__awaiter(this, void 0, void 0, function* () {
24
24
  runtimeSet = twPatcher.getClassSet();
25
25
  setMangleRuntimeSet(runtimeSet);
@@ -38,12 +38,12 @@ function createPlugins(options$1 = {}) {
38
38
  return false;
39
39
  }
40
40
  }, () => options.__awaiter(this, void 0, void 0, function* () {
41
- const code = yield styleHandler(rawSource, Object.assign({ isMainChunk: true }, options$1));
42
- file.contents = node_buffer.Buffer.from(code);
41
+ const { css } = yield styleHandler(rawSource, Object.assign({ isMainChunk: true }, options$1));
42
+ file.contents = node_buffer.Buffer.from(css);
43
43
  debug('css handle: %s', file.path);
44
44
  return {
45
45
  key: file.path,
46
- source: code,
46
+ source: css,
47
47
  };
48
48
  }));
49
49
  }
@@ -55,7 +55,7 @@ function createPlugins(options$1 = {}) {
55
55
  function transformJs(options$1 = {}) {
56
56
  return new Transform({
57
57
  objectMode: true,
58
- transform(file, encoding, callback) {
58
+ transform(file, _encoding, callback) {
59
59
  return options.__awaiter(this, void 0, void 0, function* () {
60
60
  const error = null;
61
61
  if (file.contents) {
@@ -89,7 +89,7 @@ function createPlugins(options$1 = {}) {
89
89
  function transformWxml(options$1 = {}) {
90
90
  return new Transform({
91
91
  objectMode: true,
92
- transform(file, encoding, callback) {
92
+ transform(file, _encoding, callback) {
93
93
  return options.__awaiter(this, void 0, void 0, function* () {
94
94
  const error = null;
95
95
  if (file.contents) {
@@ -21,7 +21,9 @@ function createRuleTransform(rule, options) {
21
21
  }
22
22
  if (cssRemoveHoverPseudoClass && selector.type === 'selector') {
23
23
  const node = selector.nodes.find(x => x.type === 'pseudo' && x.value === ':hover');
24
- node && selector.remove();
24
+ if (node) {
25
+ selector.remove();
26
+ }
25
27
  }
26
28
  if (selector.type === 'pseudo'
27
29
  && selector.value === ':root'
@@ -1,5 +1,5 @@
1
- import { g as getOptions, _ as __awaiter } from './options-7EjuAISl.mjs';
2
- import { v as vitePluginName } from './index-BPzIdybK.mjs';
1
+ import { g as getOptions, _ as __awaiter } from './options-BT2K7ro6.mjs';
2
+ import { v as vitePluginName } from './index-szMvMylQ.mjs';
3
3
  import { g as getGroupedEntries } from './defaults-w3rlKQwe.mjs';
4
4
  import { c as createDebug } from './index-BEIjgKpF.mjs';
5
5
 
@@ -15,7 +15,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
15
15
  return {
16
16
  name: vitePluginName,
17
17
  enforce: 'post',
18
- generateBundle(opt, bundle) {
18
+ generateBundle(_opt, bundle) {
19
19
  return __awaiter(this, void 0, void 0, function* () {
20
20
  debug('start');
21
21
  onStart();
@@ -109,7 +109,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
109
109
  return false;
110
110
  }
111
111
  }, () => __awaiter(this, void 0, void 0, function* () {
112
- const css = yield styleHandler(rawSource, {
112
+ const { css } = yield styleHandler(rawSource, {
113
113
  isMainChunk: mainCssChunkMatcher(originalSource.fileName, appType),
114
114
  });
115
115
  originalSource.source = css;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var options = require('./options-C-rvBixk.js');
4
- var index = require('./index-DwZHOkK3.js');
3
+ var options = require('./options-BjD225Hm.js');
4
+ var index = require('./index-CCbEWRGc.js');
5
5
  var defaults = require('./defaults-DW-EahCC.js');
6
6
  var index$1 = require('./index-HC-Qkn0i.js');
7
7
 
@@ -17,7 +17,7 @@ function UnifiedViteWeappTailwindcssPlugin(options$1 = {}) {
17
17
  return {
18
18
  name: index.vitePluginName,
19
19
  enforce: 'post',
20
- generateBundle(opt, bundle) {
20
+ generateBundle(_opt, bundle) {
21
21
  return options.__awaiter(this, void 0, void 0, function* () {
22
22
  debug('start');
23
23
  onStart();
@@ -111,7 +111,7 @@ function UnifiedViteWeappTailwindcssPlugin(options$1 = {}) {
111
111
  return false;
112
112
  }
113
113
  }, () => options.__awaiter(this, void 0, void 0, function* () {
114
- const css = yield styleHandler(rawSource, {
114
+ const { css } = yield styleHandler(rawSource, {
115
115
  isMainChunk: mainCssChunkMatcher(originalSource.fileName, appType),
116
116
  });
117
117
  originalSource.source = css;
@@ -1,4 +1,4 @@
1
- import { g as getOptions, _ as __awaiter } from './options-7EjuAISl.mjs';
1
+ import { g as getOptions, _ as __awaiter } from './options-BT2K7ro6.mjs';
2
2
  import stream from 'node:stream';
3
3
  import { Buffer } from 'node:buffer';
4
4
  import { c as createDebug } from './index-BEIjgKpF.mjs';
@@ -13,7 +13,7 @@ function createPlugins(options = {}) {
13
13
  function transformWxss(options = {}) {
14
14
  return new Transform({
15
15
  objectMode: true,
16
- transform(file, encoding, callback) {
16
+ transform(file, _encoding, callback) {
17
17
  return __awaiter(this, void 0, void 0, function* () {
18
18
  runtimeSet = twPatcher.getClassSet();
19
19
  setMangleRuntimeSet(runtimeSet);
@@ -32,12 +32,12 @@ function createPlugins(options = {}) {
32
32
  return false;
33
33
  }
34
34
  }, () => __awaiter(this, void 0, void 0, function* () {
35
- const code = yield styleHandler(rawSource, Object.assign({ isMainChunk: true }, options));
36
- file.contents = Buffer.from(code);
35
+ const { css } = yield styleHandler(rawSource, Object.assign({ isMainChunk: true }, options));
36
+ file.contents = Buffer.from(css);
37
37
  debug('css handle: %s', file.path);
38
38
  return {
39
39
  key: file.path,
40
- source: code,
40
+ source: css,
41
41
  };
42
42
  }));
43
43
  }
@@ -49,7 +49,7 @@ function createPlugins(options = {}) {
49
49
  function transformJs(options = {}) {
50
50
  return new Transform({
51
51
  objectMode: true,
52
- transform(file, encoding, callback) {
52
+ transform(file, _encoding, callback) {
53
53
  return __awaiter(this, void 0, void 0, function* () {
54
54
  const error = null;
55
55
  if (file.contents) {
@@ -83,7 +83,7 @@ function createPlugins(options = {}) {
83
83
  function transformWxml(options = {}) {
84
84
  return new Transform({
85
85
  objectMode: true,
86
- transform(file, encoding, callback) {
86
+ transform(file, _encoding, callback) {
87
87
  return __awaiter(this, void 0, void 0, function* () {
88
88
  const error = null;
89
89
  if (file.contents) {
@@ -13,7 +13,9 @@ function createRuleTransform(rule, options) {
13
13
  }
14
14
  if (cssRemoveHoverPseudoClass && selector.type === 'selector') {
15
15
  const node = selector.nodes.find(x => x.type === 'pseudo' && x.value === ':hover');
16
- node && selector.remove();
16
+ if (node) {
17
+ selector.remove();
18
+ }
17
19
  }
18
20
  if (selector.type === 'pseudo'
19
21
  && selector.value === ':root'