weapp-tailwindcss 3.2.0-alpha.0 → 3.2.0-alpha.2
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 +13 -2
- package/dist/cli.mjs +13 -2
- package/dist/core.js +2 -2
- package/dist/core.mjs +2 -2
- package/dist/gulp.js +3 -3
- package/dist/gulp.mjs +3 -3
- package/dist/{index-Cc9Keh2y.mjs → index-BhrpFuVY.mjs} +7 -11
- package/dist/{index-68y_DK7v.mjs → index-Bv5O41ly.mjs} +1 -1
- package/dist/{index-DceUHJsx.js → index-CJ2avZMo.js} +1 -1
- package/dist/{index-BeceVy3q.js → index-DyHMB5jI.js} +7 -11
- package/dist/index.js +7 -7
- package/dist/index.mjs +6 -6
- package/dist/{options-D44x0dJn.mjs → options-B4Q7Koe2.mjs} +8 -2
- package/dist/{options-CsgtOq1O.js → options-CJjfTssp.js} +14 -8
- package/dist/{v5-BvCYBYO9.js → v5-CbEl4DHT.js} +1 -1
- package/dist/{v5-F0XOH7NH.mjs → v5-Dxj0DyQd.mjs} +1 -1
- package/dist/vite.js +3 -3
- package/dist/vite.mjs +3 -3
- package/dist/webpack.js +3 -3
- package/dist/webpack.mjs +3 -3
- package/dist/webpack4.js +2 -2
- package/dist/webpack4.mjs +2 -2
- package/package.json +45 -44
- 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-CJjfTssp.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');
|
|
@@ -42,3 +42,14 @@ if (command === 'patch') {
|
|
|
42
42
|
const patch = options.createPatch(options$1.supportCustomLengthUnitsPatch);
|
|
43
43
|
patch();
|
|
44
44
|
}
|
|
45
|
+
else {
|
|
46
|
+
try {
|
|
47
|
+
import('@weapp-tailwindcss/cli').then(({ createCli }) => {
|
|
48
|
+
createCli().parse();
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
console.warn('请先安装 `@weapp-tailwindcss/cli` , 安装完成后再尝试运行!');
|
|
53
|
+
throw error;
|
|
54
|
+
}
|
|
55
|
+
}
|
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-B4Q7Koe2.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';
|
|
@@ -36,3 +36,14 @@ if (command === 'patch') {
|
|
|
36
36
|
const patch = createPatch(options.supportCustomLengthUnitsPatch);
|
|
37
37
|
patch();
|
|
38
38
|
}
|
|
39
|
+
else {
|
|
40
|
+
try {
|
|
41
|
+
import('@weapp-tailwindcss/cli').then(({ createCli }) => {
|
|
42
|
+
createCli().parse();
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
console.warn('请先安装 `@weapp-tailwindcss/cli` , 安装完成后再尝试运行!');
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
49
|
+
}
|
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-CJjfTssp.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-B4Q7Koe2.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-DyHMB5jI.js');
|
|
6
|
+
require('./options-CJjfTssp.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');
|
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-BhrpFuVY.mjs';
|
|
2
|
+
import './options-B4Q7Koe2.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';
|
|
@@ -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-B4Q7Koe2.mjs';
|
|
2
2
|
import stream from 'node:stream';
|
|
3
3
|
import { c as createDebug } from './index-CsZGfl55.mjs';
|
|
4
4
|
|
|
@@ -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 {
|
|
@@ -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-B4Q7Koe2.mjs';
|
|
2
2
|
import { v as vitePluginName } from './index-Br8RI9kF.mjs';
|
|
3
3
|
import { g as getGroupedEntries } from './defaults-Cpt1fUNP.mjs';
|
|
4
4
|
import { c as createDebug } from './index-CsZGfl55.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var options = require('./options-
|
|
3
|
+
var options = require('./options-CJjfTssp.js');
|
|
4
4
|
var stream = require('node:stream');
|
|
5
5
|
var index = require('./index-DyK5Vd4R.js');
|
|
6
6
|
|
|
@@ -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 {
|
package/dist/index.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var index
|
|
8
|
-
require('./options-
|
|
5
|
+
var index$1 = require('./index-DyHMB5jI.js');
|
|
6
|
+
var v5 = require('./v5-CbEl4DHT.js');
|
|
7
|
+
var index = require('./index-CJ2avZMo.js');
|
|
8
|
+
require('./options-CJjfTssp.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,12 +31,12 @@ require('tailwindcss-patch');
|
|
|
31
31
|
require('@tailwindcss-mangle/shared');
|
|
32
32
|
require('lru-cache');
|
|
33
33
|
require('md5');
|
|
34
|
+
require('node:stream');
|
|
34
35
|
require('./index-DyK5Vd4R.js');
|
|
35
36
|
require('debug');
|
|
36
|
-
require('node:stream');
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
+
exports.createPlugins = index$1.createPlugins;
|
|
40
41
|
exports.UnifiedWebpackPluginV5 = v5.UnifiedWebpackPluginV5;
|
|
41
42
|
exports.UnifiedViteWeappTailwindcssPlugin = index.UnifiedViteWeappTailwindcssPlugin;
|
|
42
|
-
exports.createPlugins = index$1.createPlugins;
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { U as
|
|
3
|
-
export {
|
|
4
|
-
import './options-
|
|
1
|
+
export { c as createPlugins } from './index-BhrpFuVY.mjs';
|
|
2
|
+
export { U as UnifiedWebpackPluginV5 } from './v5-Dxj0DyQd.mjs';
|
|
3
|
+
export { U as UnifiedViteWeappTailwindcssPlugin } from './index-Bv5O41ly.mjs';
|
|
4
|
+
import './options-B4Q7Koe2.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 'node:stream';
|
|
30
31
|
import './index-CsZGfl55.mjs';
|
|
31
32
|
import 'debug';
|
|
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');
|
|
@@ -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
|
}
|
|
@@ -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-B4Q7Koe2.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';
|
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-CJ2avZMo.js');
|
|
6
|
+
require('./options-CJjfTssp.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');
|
package/dist/vite.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { U as UnifiedViteWeappTailwindcssPlugin } from './index-
|
|
2
|
-
import './options-
|
|
1
|
+
export { U as UnifiedViteWeappTailwindcssPlugin } from './index-Bv5O41ly.mjs';
|
|
2
|
+
import './options-B4Q7Koe2.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';
|
package/dist/webpack.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var v5 = require('./v5-
|
|
6
|
-
require('./options-
|
|
5
|
+
var v5 = require('./v5-CbEl4DHT.js');
|
|
6
|
+
require('./options-CJjfTssp.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');
|
package/dist/webpack.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { U as UnifiedWebpackPluginV5 } from './v5-
|
|
2
|
-
import './options-
|
|
1
|
+
export { U as UnifiedWebpackPluginV5 } from './v5-Dxj0DyQd.mjs';
|
|
2
|
+
import './options-B4Q7Koe2.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';
|
package/dist/webpack4.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-CJjfTssp.js');
|
|
6
6
|
var path = require('node:path');
|
|
7
7
|
var fs = require('node:fs');
|
|
8
8
|
var webpackSources = require('webpack-sources');
|
|
@@ -16,8 +16,8 @@ require('@ast-core/escape');
|
|
|
16
16
|
require('./shared-BDew1Ric.js');
|
|
17
17
|
require('@weapp-core/regex');
|
|
18
18
|
require('@babel/generator');
|
|
19
|
-
require('@babel/parser');
|
|
20
19
|
require('@babel/traverse');
|
|
20
|
+
require('@babel/parser');
|
|
21
21
|
require('@babel/types');
|
|
22
22
|
require('htmlparser2');
|
|
23
23
|
require('postcss');
|
package/dist/webpack4.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-B4Q7Koe2.mjs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import fs from 'node:fs';
|
|
4
4
|
import { ConcatSource, RawSource } from 'webpack-sources';
|
|
@@ -12,8 +12,8 @@ import '@ast-core/escape';
|
|
|
12
12
|
import './shared-BX0VV-pr.mjs';
|
|
13
13
|
import '@weapp-core/regex';
|
|
14
14
|
import '@babel/generator';
|
|
15
|
-
import '@babel/parser';
|
|
16
15
|
import '@babel/traverse';
|
|
16
|
+
import '@babel/parser';
|
|
17
17
|
import '@babel/types';
|
|
18
18
|
import 'htmlparser2';
|
|
19
19
|
import 'postcss';
|