weapp-tailwindcss 3.2.0-alpha.0 → 3.2.0-alpha.10
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/babel/index.d.ts +15 -2
- package/dist/bundlers/gulp/index.d.ts +4 -4
- package/dist/cli.js +14 -2
- package/dist/cli.mjs +14 -2
- package/dist/core.js +2 -2
- package/dist/core.mjs +2 -2
- package/dist/gulp.js +4 -4
- package/dist/gulp.mjs +4 -4
- package/dist/{index-CsZGfl55.mjs → index-BEIjgKpF.mjs} +1 -1
- package/dist/{index-68y_DK7v.mjs → index-BUSWfTII.mjs} +2 -2
- package/dist/{index-BeceVy3q.js → index-BVkWxeac.js} +8 -12
- package/dist/{index-DceUHJsx.js → index-D39btBag.js} +2 -2
- package/dist/{index-Cc9Keh2y.mjs → index-DTZy_RpB.mjs} +8 -12
- package/dist/{index-DyK5Vd4R.js → index-HC-Qkn0i.js} +1 -1
- package/dist/index.js +6 -6
- package/dist/index.mjs +6 -6
- package/dist/{options-D44x0dJn.mjs → options-Bx4whTEl.mjs} +9 -3
- package/dist/{options-CsgtOq1O.js → options-D_WlG4zX.js} +15 -9
- package/dist/{v5-BvCYBYO9.js → v5-8gu_iMbg.js} +2 -2
- package/dist/{v5-F0XOH7NH.mjs → v5-CFnJIK3x.mjs} +2 -2
- package/dist/vite.js +4 -4
- package/dist/vite.mjs +4 -4
- package/dist/webpack.js +4 -4
- package/dist/webpack.mjs +4 -4
- package/dist/webpack4.js +3 -3
- package/dist/webpack4.mjs +3 -3
- package/package.json +32 -134
- package/CHANGELOG.md +0 -619
- package/README_en.md +0 -139
- package/benchmark/.vscode/extensions.json +0 -3
package/dist/babel/index.d.ts
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import _babelGenerate from '@babel/generator';
|
|
2
2
|
export { parse, parseExpression } from '@babel/parser';
|
|
3
|
-
export
|
|
3
|
+
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: "File" | "ArrayExpression" | "AnyTypeAnnotation" | "ArgumentPlaceholder" | "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" | "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
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import stream from 'node:stream';
|
|
3
|
-
import { UserDefinedOptions } from "../../types";
|
|
3
|
+
import type { CreateJsHandlerOptions, IStyleHandlerOptions, ITemplateHandlerOptions, UserDefinedOptions } from "../../types";
|
|
4
4
|
export declare function createPlugins(options?: UserDefinedOptions): {
|
|
5
|
-
transformWxss: () => stream.Transform;
|
|
6
|
-
transformWxml: () => stream.Transform;
|
|
7
|
-
transformJs: () => stream.Transform;
|
|
5
|
+
transformWxss: (options?: Partial<IStyleHandlerOptions>) => stream.Transform;
|
|
6
|
+
transformWxml: (options?: Partial<ITemplateHandlerOptions>) => stream.Transform;
|
|
7
|
+
transformJs: (options?: Partial<CreateJsHandlerOptions>) => stream.Transform;
|
|
8
8
|
};
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var semver = require('semver');
|
|
4
|
-
var options = require('./options-
|
|
4
|
+
var options = require('./options-D_WlG4zX.js');
|
|
5
5
|
var index = require('./index-DCE5ieKW.js');
|
|
6
6
|
require('magic-string');
|
|
7
7
|
require('./replace.js');
|
|
@@ -10,8 +10,8 @@ require('@ast-core/escape');
|
|
|
10
10
|
require('./shared-BDew1Ric.js');
|
|
11
11
|
require('@weapp-core/regex');
|
|
12
12
|
require('@babel/generator');
|
|
13
|
-
require('@babel/parser');
|
|
14
13
|
require('@babel/traverse');
|
|
14
|
+
require('@babel/parser');
|
|
15
15
|
require('./defaults-Mf4eWves.js');
|
|
16
16
|
require('./defu-Cdz2PomB.js');
|
|
17
17
|
require('@babel/types');
|
|
@@ -31,6 +31,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
31
31
|
|
|
32
32
|
var semver__default = /*#__PURE__*/_interopDefaultCompat(semver);
|
|
33
33
|
|
|
34
|
+
process.title = 'node (weapp-tailwindcss)';
|
|
34
35
|
const args = process.argv.slice(2);
|
|
35
36
|
if (semver__default["default"].lt(process.versions.node, index.WEAPP_TW_REQUIRED_NODE_VERSION)) {
|
|
36
37
|
console.error(`You are using Node.js ${process.versions.node}. For weapp-tailwindcss, Node.js version >= v${index.WEAPP_TW_REQUIRED_NODE_VERSION} is required.`);
|
|
@@ -42,3 +43,14 @@ if (command === 'patch') {
|
|
|
42
43
|
const patch = options.createPatch(options$1.supportCustomLengthUnitsPatch);
|
|
43
44
|
patch();
|
|
44
45
|
}
|
|
46
|
+
else {
|
|
47
|
+
try {
|
|
48
|
+
import('@weapp-tailwindcss/cli').then(({ createCli }) => {
|
|
49
|
+
createCli().parse();
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
console.warn('请先安装 `@weapp-tailwindcss/cli` , 安装完成后再尝试运行!');
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
}
|
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import semver from 'semver';
|
|
2
|
-
import { g as getOptions, a as createPatch } from './options-
|
|
2
|
+
import { g as getOptions, a as createPatch } from './options-Bx4whTEl.mjs';
|
|
3
3
|
import { W as WEAPP_TW_REQUIRED_NODE_VERSION } from './index-Br8RI9kF.mjs';
|
|
4
4
|
import 'magic-string';
|
|
5
5
|
import './replace.mjs';
|
|
@@ -8,8 +8,8 @@ import '@ast-core/escape';
|
|
|
8
8
|
import './shared-BX0VV-pr.mjs';
|
|
9
9
|
import '@weapp-core/regex';
|
|
10
10
|
import '@babel/generator';
|
|
11
|
-
import '@babel/parser';
|
|
12
11
|
import '@babel/traverse';
|
|
12
|
+
import '@babel/parser';
|
|
13
13
|
import './defaults-Cpt1fUNP.mjs';
|
|
14
14
|
import './defu-n46TJT6t.mjs';
|
|
15
15
|
import '@babel/types';
|
|
@@ -25,6 +25,7 @@ import '@csstools/postcss-is-pseudo-class';
|
|
|
25
25
|
import 'postcss-rem-to-responsive-pixel';
|
|
26
26
|
import 'postcss-selector-parser';
|
|
27
27
|
|
|
28
|
+
process.title = 'node (weapp-tailwindcss)';
|
|
28
29
|
const args = process.argv.slice(2);
|
|
29
30
|
if (semver.lt(process.versions.node, WEAPP_TW_REQUIRED_NODE_VERSION)) {
|
|
30
31
|
console.error(`You are using Node.js ${process.versions.node}. For weapp-tailwindcss, Node.js version >= v${WEAPP_TW_REQUIRED_NODE_VERSION} is required.`);
|
|
@@ -36,3 +37,14 @@ if (command === 'patch') {
|
|
|
36
37
|
const patch = createPatch(options.supportCustomLengthUnitsPatch);
|
|
37
38
|
patch();
|
|
38
39
|
}
|
|
40
|
+
else {
|
|
41
|
+
try {
|
|
42
|
+
import('@weapp-tailwindcss/cli').then(({ createCli }) => {
|
|
43
|
+
createCli().parse();
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
console.warn('请先安装 `@weapp-tailwindcss/cli` , 安装完成后再尝试运行!');
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
}
|
package/dist/core.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var options = require('./options-
|
|
5
|
+
var options = require('./options-D_WlG4zX.js');
|
|
6
6
|
require('magic-string');
|
|
7
7
|
require('./replace.js');
|
|
8
8
|
require('@weapp-core/escape');
|
|
@@ -10,8 +10,8 @@ require('@ast-core/escape');
|
|
|
10
10
|
require('./shared-BDew1Ric.js');
|
|
11
11
|
require('@weapp-core/regex');
|
|
12
12
|
require('@babel/generator');
|
|
13
|
-
require('@babel/parser');
|
|
14
13
|
require('@babel/traverse');
|
|
14
|
+
require('@babel/parser');
|
|
15
15
|
require('./defaults-Mf4eWves.js');
|
|
16
16
|
require('./defu-Cdz2PomB.js');
|
|
17
17
|
require('@babel/types');
|
package/dist/core.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-
|
|
1
|
+
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-Bx4whTEl.mjs';
|
|
2
2
|
import 'magic-string';
|
|
3
3
|
import './replace.mjs';
|
|
4
4
|
import '@weapp-core/escape';
|
|
@@ -6,8 +6,8 @@ import '@ast-core/escape';
|
|
|
6
6
|
import './shared-BX0VV-pr.mjs';
|
|
7
7
|
import '@weapp-core/regex';
|
|
8
8
|
import '@babel/generator';
|
|
9
|
-
import '@babel/parser';
|
|
10
9
|
import '@babel/traverse';
|
|
10
|
+
import '@babel/parser';
|
|
11
11
|
import './defaults-Cpt1fUNP.mjs';
|
|
12
12
|
import './defu-n46TJT6t.mjs';
|
|
13
13
|
import '@babel/types';
|
package/dist/gulp.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./index-
|
|
6
|
-
require('./options-
|
|
5
|
+
var index = require('./index-BVkWxeac.js');
|
|
6
|
+
require('./options-D_WlG4zX.js');
|
|
7
7
|
require('magic-string');
|
|
8
8
|
require('./replace.js');
|
|
9
9
|
require('@weapp-core/escape');
|
|
@@ -11,8 +11,8 @@ require('@ast-core/escape');
|
|
|
11
11
|
require('./shared-BDew1Ric.js');
|
|
12
12
|
require('@weapp-core/regex');
|
|
13
13
|
require('@babel/generator');
|
|
14
|
-
require('@babel/parser');
|
|
15
14
|
require('@babel/traverse');
|
|
15
|
+
require('@babel/parser');
|
|
16
16
|
require('./defaults-Mf4eWves.js');
|
|
17
17
|
require('./defu-Cdz2PomB.js');
|
|
18
18
|
require('@babel/types');
|
|
@@ -30,7 +30,7 @@ require('@tailwindcss-mangle/shared');
|
|
|
30
30
|
require('lru-cache');
|
|
31
31
|
require('md5');
|
|
32
32
|
require('node:stream');
|
|
33
|
-
require('./index-
|
|
33
|
+
require('./index-HC-Qkn0i.js');
|
|
34
34
|
require('debug');
|
|
35
35
|
|
|
36
36
|
|
package/dist/gulp.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { c as createPlugins } from './index-
|
|
2
|
-
import './options-
|
|
1
|
+
export { c as createPlugins } from './index-DTZy_RpB.mjs';
|
|
2
|
+
import './options-Bx4whTEl.mjs';
|
|
3
3
|
import 'magic-string';
|
|
4
4
|
import './replace.mjs';
|
|
5
5
|
import '@weapp-core/escape';
|
|
@@ -7,8 +7,8 @@ import '@ast-core/escape';
|
|
|
7
7
|
import './shared-BX0VV-pr.mjs';
|
|
8
8
|
import '@weapp-core/regex';
|
|
9
9
|
import '@babel/generator';
|
|
10
|
-
import '@babel/parser';
|
|
11
10
|
import '@babel/traverse';
|
|
11
|
+
import '@babel/parser';
|
|
12
12
|
import './defaults-Cpt1fUNP.mjs';
|
|
13
13
|
import './defu-n46TJT6t.mjs';
|
|
14
14
|
import '@babel/types';
|
|
@@ -26,5 +26,5 @@ import '@tailwindcss-mangle/shared';
|
|
|
26
26
|
import 'lru-cache';
|
|
27
27
|
import 'md5';
|
|
28
28
|
import 'node:stream';
|
|
29
|
-
import './index-
|
|
29
|
+
import './index-BEIjgKpF.mjs';
|
|
30
30
|
import 'debug';
|
|
@@ -3,7 +3,7 @@ import _createDebug from 'debug';
|
|
|
3
3
|
const _debug = _createDebug('weapp-tw');
|
|
4
4
|
function createDebug(prefix) {
|
|
5
5
|
function debug(formatter, ...args) {
|
|
6
|
-
return _debug((
|
|
6
|
+
return _debug(('') + formatter, ...args);
|
|
7
7
|
}
|
|
8
8
|
return debug;
|
|
9
9
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-
|
|
1
|
+
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-Bx4whTEl.mjs';
|
|
2
2
|
import { v as vitePluginName } from './index-Br8RI9kF.mjs';
|
|
3
3
|
import { g as getGroupedEntries } from './defaults-Cpt1fUNP.mjs';
|
|
4
|
-
import { c as createDebug } from './index-
|
|
4
|
+
import { c as createDebug } from './index-BEIjgKpF.mjs';
|
|
5
5
|
|
|
6
6
|
const debug = createDebug();
|
|
7
7
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var options = require('./options-
|
|
3
|
+
var options = require('./options-D_WlG4zX.js');
|
|
4
4
|
var stream = require('node:stream');
|
|
5
|
-
var index = require('./index-
|
|
5
|
+
var index = require('./index-HC-Qkn0i.js');
|
|
6
6
|
|
|
7
7
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
8
8
|
|
|
@@ -16,7 +16,7 @@ function createPlugins(options$1 = {}) {
|
|
|
16
16
|
let runtimeSet = new Set();
|
|
17
17
|
patch === null || patch === void 0 ? void 0 : patch();
|
|
18
18
|
const twPatcher = options.createTailwindcssPatcher();
|
|
19
|
-
function transformWxss() {
|
|
19
|
+
function transformWxss(options$1 = {}) {
|
|
20
20
|
return new Transform({
|
|
21
21
|
objectMode: true,
|
|
22
22
|
transform: function (file, encoding, callback) {
|
|
@@ -40,9 +40,7 @@ function createPlugins(options$1 = {}) {
|
|
|
40
40
|
return false;
|
|
41
41
|
}
|
|
42
42
|
}, () => options.__awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
const code = yield styleHandler(rawSource, {
|
|
44
|
-
isMainChunk: true
|
|
45
|
-
});
|
|
43
|
+
const code = yield styleHandler(rawSource, Object.assign({ isMainChunk: true }, options$1));
|
|
46
44
|
file.contents = Buffer.from(code);
|
|
47
45
|
debug('css handle: %s', file.path);
|
|
48
46
|
return {
|
|
@@ -56,7 +54,7 @@ function createPlugins(options$1 = {}) {
|
|
|
56
54
|
}
|
|
57
55
|
});
|
|
58
56
|
}
|
|
59
|
-
function transformJs() {
|
|
57
|
+
function transformJs(options$1 = {}) {
|
|
60
58
|
return new Transform({
|
|
61
59
|
objectMode: true,
|
|
62
60
|
transform: function (file, encoding, callback) {
|
|
@@ -76,7 +74,7 @@ function createPlugins(options$1 = {}) {
|
|
|
76
74
|
return false;
|
|
77
75
|
}
|
|
78
76
|
}, () => options.__awaiter(this, void 0, void 0, function* () {
|
|
79
|
-
const { code } = yield jsHandler(rawSource, runtimeSet);
|
|
77
|
+
const { code } = yield jsHandler(rawSource, runtimeSet, options$1);
|
|
80
78
|
file.contents = Buffer.from(code);
|
|
81
79
|
debug('js handle: %s', file.path);
|
|
82
80
|
return {
|
|
@@ -90,7 +88,7 @@ function createPlugins(options$1 = {}) {
|
|
|
90
88
|
}
|
|
91
89
|
});
|
|
92
90
|
}
|
|
93
|
-
function transformWxml() {
|
|
91
|
+
function transformWxml(options$1 = {}) {
|
|
94
92
|
return new Transform({
|
|
95
93
|
objectMode: true,
|
|
96
94
|
transform: function (file, encoding, callback) {
|
|
@@ -110,9 +108,7 @@ function createPlugins(options$1 = {}) {
|
|
|
110
108
|
return false;
|
|
111
109
|
}
|
|
112
110
|
}, () => options.__awaiter(this, void 0, void 0, function* () {
|
|
113
|
-
const code = yield templateHandler(rawSource, {
|
|
114
|
-
runtimeSet
|
|
115
|
-
});
|
|
111
|
+
const code = yield templateHandler(rawSource, Object.assign({ runtimeSet }, options$1));
|
|
116
112
|
file.contents = Buffer.from(code);
|
|
117
113
|
debug('html handle: %s', file.path);
|
|
118
114
|
return {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var options = require('./options-
|
|
3
|
+
var options = require('./options-D_WlG4zX.js');
|
|
4
4
|
var index = require('./index-DCE5ieKW.js');
|
|
5
5
|
var defaults = require('./defaults-Mf4eWves.js');
|
|
6
|
-
var index$1 = require('./index-
|
|
6
|
+
var index$1 = require('./index-HC-Qkn0i.js');
|
|
7
7
|
|
|
8
8
|
const debug = index$1.createDebug();
|
|
9
9
|
function UnifiedViteWeappTailwindcssPlugin(options$1 = {}) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-
|
|
1
|
+
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-Bx4whTEl.mjs';
|
|
2
2
|
import stream from 'node:stream';
|
|
3
|
-
import { c as createDebug } from './index-
|
|
3
|
+
import { c as createDebug } from './index-BEIjgKpF.mjs';
|
|
4
4
|
|
|
5
5
|
const debug = createDebug();
|
|
6
6
|
const Transform = stream.Transform;
|
|
@@ -10,7 +10,7 @@ function createPlugins(options = {}) {
|
|
|
10
10
|
let runtimeSet = new Set();
|
|
11
11
|
patch === null || patch === void 0 ? void 0 : patch();
|
|
12
12
|
const twPatcher = createTailwindcssPatcher();
|
|
13
|
-
function transformWxss() {
|
|
13
|
+
function transformWxss(options = {}) {
|
|
14
14
|
return new Transform({
|
|
15
15
|
objectMode: true,
|
|
16
16
|
transform: function (file, encoding, callback) {
|
|
@@ -34,9 +34,7 @@ function createPlugins(options = {}) {
|
|
|
34
34
|
return false;
|
|
35
35
|
}
|
|
36
36
|
}, () => __awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
const code = yield styleHandler(rawSource, {
|
|
38
|
-
isMainChunk: true
|
|
39
|
-
});
|
|
37
|
+
const code = yield styleHandler(rawSource, Object.assign({ isMainChunk: true }, options));
|
|
40
38
|
file.contents = Buffer.from(code);
|
|
41
39
|
debug('css handle: %s', file.path);
|
|
42
40
|
return {
|
|
@@ -50,7 +48,7 @@ function createPlugins(options = {}) {
|
|
|
50
48
|
}
|
|
51
49
|
});
|
|
52
50
|
}
|
|
53
|
-
function transformJs() {
|
|
51
|
+
function transformJs(options = {}) {
|
|
54
52
|
return new Transform({
|
|
55
53
|
objectMode: true,
|
|
56
54
|
transform: function (file, encoding, callback) {
|
|
@@ -70,7 +68,7 @@ function createPlugins(options = {}) {
|
|
|
70
68
|
return false;
|
|
71
69
|
}
|
|
72
70
|
}, () => __awaiter(this, void 0, void 0, function* () {
|
|
73
|
-
const { code } = yield jsHandler(rawSource, runtimeSet);
|
|
71
|
+
const { code } = yield jsHandler(rawSource, runtimeSet, options);
|
|
74
72
|
file.contents = Buffer.from(code);
|
|
75
73
|
debug('js handle: %s', file.path);
|
|
76
74
|
return {
|
|
@@ -84,7 +82,7 @@ function createPlugins(options = {}) {
|
|
|
84
82
|
}
|
|
85
83
|
});
|
|
86
84
|
}
|
|
87
|
-
function transformWxml() {
|
|
85
|
+
function transformWxml(options = {}) {
|
|
88
86
|
return new Transform({
|
|
89
87
|
objectMode: true,
|
|
90
88
|
transform: function (file, encoding, callback) {
|
|
@@ -104,9 +102,7 @@ function createPlugins(options = {}) {
|
|
|
104
102
|
return false;
|
|
105
103
|
}
|
|
106
104
|
}, () => __awaiter(this, void 0, void 0, function* () {
|
|
107
|
-
const code = yield templateHandler(rawSource, {
|
|
108
|
-
runtimeSet
|
|
109
|
-
});
|
|
105
|
+
const code = yield templateHandler(rawSource, Object.assign({ runtimeSet }, options));
|
|
110
106
|
file.contents = Buffer.from(code);
|
|
111
107
|
debug('html handle: %s', file.path);
|
|
112
108
|
return {
|
|
@@ -9,7 +9,7 @@ var _createDebug__default = /*#__PURE__*/_interopDefaultCompat(_createDebug);
|
|
|
9
9
|
const _debug = _createDebug__default["default"]('weapp-tw');
|
|
10
10
|
function createDebug(prefix) {
|
|
11
11
|
function debug(formatter, ...args) {
|
|
12
|
-
return _debug((
|
|
12
|
+
return _debug(('') + formatter, ...args);
|
|
13
13
|
}
|
|
14
14
|
return debug;
|
|
15
15
|
}
|
package/dist/index.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var v5 = require('./v5-
|
|
6
|
-
var index = require('./index-
|
|
7
|
-
var index$1 = require('./index-
|
|
8
|
-
require('./options-
|
|
5
|
+
var v5 = require('./v5-8gu_iMbg.js');
|
|
6
|
+
var index = require('./index-D39btBag.js');
|
|
7
|
+
var index$1 = require('./index-BVkWxeac.js');
|
|
8
|
+
require('./options-D_WlG4zX.js');
|
|
9
9
|
require('magic-string');
|
|
10
10
|
require('./replace.js');
|
|
11
11
|
require('@weapp-core/escape');
|
|
@@ -13,8 +13,8 @@ require('@ast-core/escape');
|
|
|
13
13
|
require('./shared-BDew1Ric.js');
|
|
14
14
|
require('@weapp-core/regex');
|
|
15
15
|
require('@babel/generator');
|
|
16
|
-
require('@babel/parser');
|
|
17
16
|
require('@babel/traverse');
|
|
17
|
+
require('@babel/parser');
|
|
18
18
|
require('./defaults-Mf4eWves.js');
|
|
19
19
|
require('./defu-Cdz2PomB.js');
|
|
20
20
|
require('@babel/types');
|
|
@@ -31,7 +31,7 @@ require('tailwindcss-patch');
|
|
|
31
31
|
require('@tailwindcss-mangle/shared');
|
|
32
32
|
require('lru-cache');
|
|
33
33
|
require('md5');
|
|
34
|
-
require('./index-
|
|
34
|
+
require('./index-HC-Qkn0i.js');
|
|
35
35
|
require('debug');
|
|
36
36
|
require('node:stream');
|
|
37
37
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { U as UnifiedWebpackPluginV5 } from './v5-
|
|
2
|
-
export { U as UnifiedViteWeappTailwindcssPlugin } from './index-
|
|
3
|
-
export { c as createPlugins } from './index-
|
|
4
|
-
import './options-
|
|
1
|
+
export { U as UnifiedWebpackPluginV5 } from './v5-CFnJIK3x.mjs';
|
|
2
|
+
export { U as UnifiedViteWeappTailwindcssPlugin } from './index-BUSWfTII.mjs';
|
|
3
|
+
export { c as createPlugins } from './index-DTZy_RpB.mjs';
|
|
4
|
+
import './options-Bx4whTEl.mjs';
|
|
5
5
|
import 'magic-string';
|
|
6
6
|
import './replace.mjs';
|
|
7
7
|
import '@weapp-core/escape';
|
|
@@ -9,8 +9,8 @@ import '@ast-core/escape';
|
|
|
9
9
|
import './shared-BX0VV-pr.mjs';
|
|
10
10
|
import '@weapp-core/regex';
|
|
11
11
|
import '@babel/generator';
|
|
12
|
-
import '@babel/parser';
|
|
13
12
|
import '@babel/traverse';
|
|
13
|
+
import '@babel/parser';
|
|
14
14
|
import './defaults-Cpt1fUNP.mjs';
|
|
15
15
|
import './defu-n46TJT6t.mjs';
|
|
16
16
|
import '@babel/types';
|
|
@@ -27,6 +27,6 @@ import 'tailwindcss-patch';
|
|
|
27
27
|
import '@tailwindcss-mangle/shared';
|
|
28
28
|
import 'lru-cache';
|
|
29
29
|
import 'md5';
|
|
30
|
-
import './index-
|
|
30
|
+
import './index-BEIjgKpF.mjs';
|
|
31
31
|
import 'debug';
|
|
32
32
|
import 'node:stream';
|
|
@@ -3,9 +3,9 @@ import { replaceJs as replaceWxml } from './replace.mjs';
|
|
|
3
3
|
import { escapeStringRegexp, variableRegExp } from '@weapp-core/regex';
|
|
4
4
|
import { SimpleMappingChars2String } from '@weapp-core/escape';
|
|
5
5
|
import { jsStringEscape } from '@ast-core/escape';
|
|
6
|
-
import
|
|
6
|
+
import _babelGenerate from '@babel/generator';
|
|
7
|
+
import _babelTraverse from '@babel/traverse';
|
|
7
8
|
import { parse, parseExpression } from '@babel/parser';
|
|
8
|
-
import traverse from '@babel/traverse';
|
|
9
9
|
import { d as defuOverrideArray, n as noop, a as defaultOptions, i as isMap } from './defaults-Cpt1fUNP.mjs';
|
|
10
10
|
import * as t from '@babel/types';
|
|
11
11
|
import { Parser } from 'htmlparser2';
|
|
@@ -103,6 +103,12 @@ function replaceHandleValue(str, node, options, ms, offset = 0) {
|
|
|
103
103
|
return rawStr;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
function _interopDefaultCompat(e) {
|
|
107
|
+
return e && typeof e === 'object' && 'default' in e ? e.default : e;
|
|
108
|
+
}
|
|
109
|
+
const generate = _interopDefaultCompat(_babelGenerate);
|
|
110
|
+
const traverse = _interopDefaultCompat(_babelTraverse);
|
|
111
|
+
|
|
106
112
|
function isEvalPath(p) {
|
|
107
113
|
if (p.isCallExpression()) {
|
|
108
114
|
const calleePath = p.get('callee');
|
|
@@ -574,7 +580,7 @@ function monkeyPatchForSupportingCustomUnit(rootDir, options) {
|
|
|
574
580
|
}
|
|
575
581
|
function internalPatch(pkgJsonPath, options, overwrite = true) {
|
|
576
582
|
if (pkgJsonPath) {
|
|
577
|
-
const pkgJson =
|
|
583
|
+
const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf8'));
|
|
578
584
|
const dangerousOptions = options.dangerousOptions;
|
|
579
585
|
const version = pkgJson.version;
|
|
580
586
|
if (gte(version, dangerousOptions.gteVersion)) {
|
|
@@ -5,9 +5,9 @@ var replace = require('./replace.js');
|
|
|
5
5
|
var regex = require('@weapp-core/regex');
|
|
6
6
|
var escape$1 = require('@weapp-core/escape');
|
|
7
7
|
var escape = require('@ast-core/escape');
|
|
8
|
-
var
|
|
8
|
+
var _babelGenerate = require('@babel/generator');
|
|
9
|
+
var _babelTraverse = require('@babel/traverse');
|
|
9
10
|
var parser = require('@babel/parser');
|
|
10
|
-
var traverse = require('@babel/traverse');
|
|
11
11
|
var defaults = require('./defaults-Mf4eWves.js');
|
|
12
12
|
var t = require('@babel/types');
|
|
13
13
|
var htmlparser2 = require('htmlparser2');
|
|
@@ -42,8 +42,8 @@ function _interopNamespaceCompat(e) {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
var MagicString__default = /*#__PURE__*/_interopDefaultCompat(MagicString);
|
|
45
|
-
var
|
|
46
|
-
var
|
|
45
|
+
var _babelGenerate__default = /*#__PURE__*/_interopDefaultCompat(_babelGenerate);
|
|
46
|
+
var _babelTraverse__default = /*#__PURE__*/_interopDefaultCompat(_babelTraverse);
|
|
47
47
|
var t__namespace = /*#__PURE__*/_interopNamespaceCompat(t);
|
|
48
48
|
var postcss__default = /*#__PURE__*/_interopDefaultCompat(postcss);
|
|
49
49
|
var path__default = /*#__PURE__*/_interopDefaultCompat(path);
|
|
@@ -134,6 +134,12 @@ function replaceHandleValue(str, node, options, ms, offset = 0) {
|
|
|
134
134
|
return rawStr;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
function _interopDefaultCompat$1(e) {
|
|
138
|
+
return e && typeof e === 'object' && 'default' in e ? e.default : e;
|
|
139
|
+
}
|
|
140
|
+
const generate = _interopDefaultCompat$1(_babelGenerate__default["default"]);
|
|
141
|
+
const traverse = _interopDefaultCompat$1(_babelTraverse__default["default"]);
|
|
142
|
+
|
|
137
143
|
function isEvalPath(p) {
|
|
138
144
|
if (p.isCallExpression()) {
|
|
139
145
|
const calleePath = p.get('callee');
|
|
@@ -252,7 +258,7 @@ function jsHandler(rawSource, options) {
|
|
|
252
258
|
}
|
|
253
259
|
}
|
|
254
260
|
};
|
|
255
|
-
|
|
261
|
+
traverse(ast, traverseOptions);
|
|
256
262
|
return {
|
|
257
263
|
code: ms.toString()
|
|
258
264
|
};
|
|
@@ -301,7 +307,7 @@ function generateCode(match, options = {}) {
|
|
|
301
307
|
try {
|
|
302
308
|
const ms = new MagicString__default["default"](match);
|
|
303
309
|
const ast = parser.parseExpression(match);
|
|
304
|
-
|
|
310
|
+
traverse(ast, {
|
|
305
311
|
StringLiteral(path) {
|
|
306
312
|
var _a;
|
|
307
313
|
if (t__namespace.isMemberExpression(path.parent)) {
|
|
@@ -513,7 +519,7 @@ function findAstNode(content, options) {
|
|
|
513
519
|
const ast = parser.parse(content);
|
|
514
520
|
let arrayRef;
|
|
515
521
|
let changed = false;
|
|
516
|
-
|
|
522
|
+
traverse(ast, {
|
|
517
523
|
Identifier(path) {
|
|
518
524
|
if (path.node.name === DOPTS.variableName && t__namespace.isVariableDeclarator(path.parent) && t__namespace.isArrayExpression(path.parent.init)) {
|
|
519
525
|
arrayRef = path.parent.init;
|
|
@@ -584,7 +590,7 @@ function monkeyPatchForSupportingCustomUnit(rootDir, options) {
|
|
|
584
590
|
});
|
|
585
591
|
const { arrayRef, changed } = findAstNode(dataTypesFileContent, options);
|
|
586
592
|
if (arrayRef && changed) {
|
|
587
|
-
const { code } =
|
|
593
|
+
const { code } = generate(arrayRef, {
|
|
588
594
|
jsescOption: {
|
|
589
595
|
quotes: 'single'
|
|
590
596
|
}
|
|
@@ -605,7 +611,7 @@ function monkeyPatchForSupportingCustomUnit(rootDir, options) {
|
|
|
605
611
|
}
|
|
606
612
|
function internalPatch(pkgJsonPath, options, overwrite = true) {
|
|
607
613
|
if (pkgJsonPath) {
|
|
608
|
-
const pkgJson =
|
|
614
|
+
const pkgJson = JSON.parse(fs__default["default"].readFileSync(pkgJsonPath, 'utf8'));
|
|
609
615
|
const dangerousOptions = options.dangerousOptions;
|
|
610
616
|
const version = pkgJson.version;
|
|
611
617
|
if (semver.gte(version, dangerousOptions.gteVersion)) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var options = require('./options-
|
|
3
|
+
var options = require('./options-D_WlG4zX.js');
|
|
4
4
|
var path = require('node:path');
|
|
5
5
|
var fs = require('node:fs');
|
|
6
6
|
var index = require('./index-DCE5ieKW.js');
|
|
7
7
|
var defaults = require('./defaults-Mf4eWves.js');
|
|
8
|
-
var index$1 = require('./index-
|
|
8
|
+
var index$1 = require('./index-HC-Qkn0i.js');
|
|
9
9
|
|
|
10
10
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
11
11
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-
|
|
1
|
+
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-Bx4whTEl.mjs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import fs from 'node:fs';
|
|
4
4
|
import { b as pluginName } from './index-Br8RI9kF.mjs';
|
|
5
5
|
import { g as getGroupedEntries, r as removeExt } from './defaults-Cpt1fUNP.mjs';
|
|
6
|
-
import { c as createDebug } from './index-
|
|
6
|
+
import { c as createDebug } from './index-BEIjgKpF.mjs';
|
|
7
7
|
|
|
8
8
|
const debug = createDebug();
|
|
9
9
|
class UnifiedWebpackPluginV5 {
|
package/dist/vite.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./index-
|
|
6
|
-
require('./options-
|
|
5
|
+
var index = require('./index-D39btBag.js');
|
|
6
|
+
require('./options-D_WlG4zX.js');
|
|
7
7
|
require('magic-string');
|
|
8
8
|
require('./replace.js');
|
|
9
9
|
require('@weapp-core/escape');
|
|
@@ -11,8 +11,8 @@ require('@ast-core/escape');
|
|
|
11
11
|
require('./shared-BDew1Ric.js');
|
|
12
12
|
require('@weapp-core/regex');
|
|
13
13
|
require('@babel/generator');
|
|
14
|
-
require('@babel/parser');
|
|
15
14
|
require('@babel/traverse');
|
|
15
|
+
require('@babel/parser');
|
|
16
16
|
require('./defaults-Mf4eWves.js');
|
|
17
17
|
require('./defu-Cdz2PomB.js');
|
|
18
18
|
require('@babel/types');
|
|
@@ -29,7 +29,7 @@ require('tailwindcss-patch');
|
|
|
29
29
|
require('@tailwindcss-mangle/shared');
|
|
30
30
|
require('lru-cache');
|
|
31
31
|
require('md5');
|
|
32
|
-
require('./index-
|
|
32
|
+
require('./index-HC-Qkn0i.js');
|
|
33
33
|
require('debug');
|
|
34
34
|
|
|
35
35
|
|