weapp-tailwindcss 2.6.1 → 2.6.3
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/cli.js +6 -5
- package/dist/cli.mjs +6 -5
- package/dist/{defaults-0d9846f4.js → defaults-28cfeec8.js} +5 -8
- package/dist/{defaults-c7f00aae.mjs → defaults-702719e1.mjs} +5 -7
- package/dist/defaults.js +2 -2
- package/dist/defaults.mjs +2 -2
- package/dist/escape.d.ts +1 -3
- package/dist/gulp.js +8 -7
- package/dist/gulp.mjs +8 -7
- package/dist/index.js +6 -5
- package/dist/index.mjs +6 -5
- package/dist/{options-6a265426.js → options-43afee21.js} +89 -162
- package/dist/{options-800ea85a.mjs → options-d8cb9e14.mjs} +66 -139
- package/dist/postcss/shared.d.ts +0 -1
- package/dist/{postcss-cf8b998a.js → postcss-4e99a8e8.js} +35 -35
- package/dist/{postcss-53e2ad95.mjs → postcss-a551ddc0.mjs} +35 -35
- package/dist/postcss.js +3 -3
- package/dist/postcss.mjs +3 -3
- package/dist/reg.d.ts +1 -26
- package/dist/replace.d.ts +1 -1
- package/dist/replace.js +24 -9
- package/dist/replace.mjs +4 -5
- package/dist/shared-df9de23f.js +17 -0
- package/dist/shared-fd149084.mjs +15 -0
- package/dist/types.d.ts +4 -8
- package/dist/vite.js +8 -7
- package/dist/vite.mjs +8 -7
- package/dist/webpack.js +8 -7
- package/dist/webpack.mjs +8 -7
- package/dist/wxml/index.d.ts +1 -1
- package/dist/wxml/shared.d.ts +2 -2
- package/dist/wxml/utils.d.ts +6 -6
- package/package.json +20 -18
- package/dist/dic-05980807.js +0 -111
- package/dist/dic-3790a3a4.mjs +0 -105
- package/dist/dic.d.ts +0 -44
- package/dist/shared-4eed0e5c.js +0 -62
- package/dist/shared-686bfc32.mjs +0 -59
package/dist/postcss.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var postcss = require('./postcss-
|
|
5
|
+
var postcss = require('./postcss-4e99a8e8.js');
|
|
6
6
|
var postcssIsPseudoClass = require('@csstools/postcss-is-pseudo-class');
|
|
7
7
|
require('postcss-selector-parser');
|
|
8
|
-
require('./shared-
|
|
9
|
-
require('
|
|
8
|
+
require('./shared-df9de23f.js');
|
|
9
|
+
require('@weapp-core/escape');
|
|
10
10
|
require('postcss');
|
|
11
11
|
|
|
12
12
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
package/dist/postcss.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { p as postcssWeappTailwindcss } from './postcss-
|
|
1
|
+
export { p as postcssWeappTailwindcss } from './postcss-a551ddc0.mjs';
|
|
2
2
|
export { default as postcssIsPseudoClass } from '@csstools/postcss-is-pseudo-class';
|
|
3
3
|
import 'postcss-selector-parser';
|
|
4
|
-
import './shared-
|
|
5
|
-
import '
|
|
4
|
+
import './shared-fd149084.mjs';
|
|
5
|
+
import '@weapp-core/escape';
|
|
6
6
|
import 'postcss';
|
package/dist/reg.d.ts
CHANGED
|
@@ -1,26 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function escapeStringRegexp(str: string): string;
|
|
3
|
-
export declare const templateClassExactRegexp: RegExp;
|
|
4
|
-
export declare const tagWithEitherClassAndHoverClassRegexp: RegExp;
|
|
5
|
-
interface ICreateRegexpOptions {
|
|
6
|
-
exact?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare function handleRegexp(reg: RegExp): string;
|
|
9
|
-
export declare function getSourceString(input: string | RegExp): string;
|
|
10
|
-
export declare function makePattern(arr: ItemOrItemArray<string | RegExp>): string;
|
|
11
|
-
export declare function createTempleteHandlerMatchRegexp(tag: string | RegExp, attrs: ItemOrItemArray<string | RegExp>, options?: ICreateRegexpOptions): RegExp;
|
|
12
|
-
export declare function createTemplateClassRegexp(attrs: ItemOrItemArray<string | RegExp>, options?: ICreateRegexpOptions): RegExp;
|
|
13
|
-
export declare function makeCustomAttributes(entries?: [string | RegExp, ItemOrItemArray<string | RegExp>][]): ICustomRegexp[] | undefined;
|
|
14
|
-
export declare const variableRegExp: RegExp;
|
|
15
|
-
export declare const classRegexp: RegExp;
|
|
16
|
-
export declare const vueTemplateClassRegexp: RegExp;
|
|
17
|
-
export declare const tagRegexp: RegExp;
|
|
18
|
-
export declare const tagWithClassRegexp: RegExp;
|
|
19
|
-
export declare function classStringReplace(str: string, replacement: (substring: string, ...args: any[]) => string): string;
|
|
20
|
-
export declare function tagStringReplace(str: string, replacement: (substring: string, ...args: any[]) => string): string;
|
|
21
|
-
export declare const wxsTagRegexp: RegExp;
|
|
22
|
-
export declare const wxmlAllowClassCharsRegExp: RegExp;
|
|
23
|
-
export declare function createWxmlAllowClassCharsRegExp(): RegExp;
|
|
24
|
-
export declare const doubleQuoteRegexp: RegExp;
|
|
25
|
-
export declare function doubleQuoteStringReplace(str: string, replacement: (substring: string, ...args: any[]) => string): string;
|
|
26
|
-
export {};
|
|
1
|
+
export * from '@weapp-core/regex';
|
package/dist/replace.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { MappingChars2String, MappingChars2StringEntries, MappingStringDictionary, SYMBOL_TABLE, SYMBOL_TABLE_TYPE, SYMBOL_TABLE_TYPE_VALUES, SimpleMappingChars2String, SimpleMappingChars2StringEntries } from './escape';
|
|
2
2
|
export { replaceWxml as replaceJs } from './wxml/shared';
|
|
3
3
|
export { internalCssSelectorReplacer as replaceCss } from './postcss/shared';
|
package/dist/replace.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var shared = require('./shared-
|
|
5
|
+
var escape = require('@weapp-core/escape');
|
|
6
|
+
var shared = require('./shared-df9de23f.js');
|
|
7
7
|
|
|
8
8
|
function replaceWxml(original, options = {
|
|
9
9
|
keepEOL: false,
|
|
10
|
-
escapeMap:
|
|
10
|
+
escapeMap: escape.SimpleMappingChars2String
|
|
11
11
|
}) {
|
|
12
12
|
const { keepEOL, escapeMap, mangleContext } = options;
|
|
13
13
|
let res = original;
|
|
@@ -18,16 +18,31 @@ function replaceWxml(original, options = {
|
|
|
18
18
|
if (mangleContext) {
|
|
19
19
|
res = mangleContext.wxmlHandler(res);
|
|
20
20
|
}
|
|
21
|
-
res =
|
|
21
|
+
res = escape.escape(res, {
|
|
22
22
|
map: escapeMap
|
|
23
23
|
});
|
|
24
24
|
return res;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
exports
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
exports
|
|
27
|
+
Object.defineProperty(exports, 'MappingChars2String', {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () { return escape.MappingChars2String; }
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, 'MappingChars2StringEntries', {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () { return escape.MappingChars2StringEntries; }
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(exports, 'SYMBOL_TABLE', {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () { return escape.SYMBOL_TABLE; }
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(exports, 'SimpleMappingChars2String', {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () { return escape.SimpleMappingChars2String; }
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(exports, 'SimpleMappingChars2StringEntries', {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () { return escape.SimpleMappingChars2StringEntries; }
|
|
46
|
+
});
|
|
32
47
|
exports.replaceCss = shared.internalCssSelectorReplacer;
|
|
33
48
|
exports.replaceJs = replaceWxml;
|
package/dist/replace.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
export { i as replaceCss } from './shared-686bfc32.mjs';
|
|
1
|
+
import { escape, SimpleMappingChars2String } from '@weapp-core/escape';
|
|
2
|
+
export { MappingChars2String, MappingChars2StringEntries, SYMBOL_TABLE, SimpleMappingChars2String, SimpleMappingChars2StringEntries } from '@weapp-core/escape';
|
|
3
|
+
export { i as replaceCss } from './shared-fd149084.mjs';
|
|
5
4
|
|
|
6
5
|
function replaceWxml(original, options = {
|
|
7
6
|
keepEOL: false,
|
|
@@ -22,4 +21,4 @@ function replaceWxml(original, options = {
|
|
|
22
21
|
return res;
|
|
23
22
|
}
|
|
24
23
|
|
|
25
|
-
export {
|
|
24
|
+
export { replaceWxml as replaceJs };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var escape = require('@weapp-core/escape');
|
|
4
|
+
|
|
5
|
+
function internalCssSelectorReplacer(selectors, options = {
|
|
6
|
+
escapeMap: escape.SimpleMappingChars2String
|
|
7
|
+
}) {
|
|
8
|
+
const { mangleContext, escapeMap } = options;
|
|
9
|
+
if (mangleContext) {
|
|
10
|
+
selectors = mangleContext.cssHandler(selectors);
|
|
11
|
+
}
|
|
12
|
+
return escape.escape(selectors, {
|
|
13
|
+
map: escapeMap
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exports.internalCssSelectorReplacer = internalCssSelectorReplacer;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { escape, SimpleMappingChars2String } from '@weapp-core/escape';
|
|
2
|
+
|
|
3
|
+
function internalCssSelectorReplacer(selectors, options = {
|
|
4
|
+
escapeMap: SimpleMappingChars2String
|
|
5
|
+
}) {
|
|
6
|
+
const { mangleContext, escapeMap } = options;
|
|
7
|
+
if (mangleContext) {
|
|
8
|
+
selectors = mangleContext.cssHandler(selectors);
|
|
9
|
+
}
|
|
10
|
+
return escape(selectors, {
|
|
11
|
+
map: escapeMap
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { internalCssSelectorReplacer as i };
|
package/dist/types.d.ts
CHANGED
|
@@ -93,6 +93,7 @@ export interface UserDefinedOptions {
|
|
|
93
93
|
inlineWxs?: boolean;
|
|
94
94
|
injectAdditionalCssVarScope?: boolean;
|
|
95
95
|
jsPreserveClass?: (keyword: string) => boolean | undefined;
|
|
96
|
+
disabledDefaultTemplateHandler?: boolean;
|
|
96
97
|
}
|
|
97
98
|
export interface IMangleScopeContext {
|
|
98
99
|
rawOptions: UserDefinedOptions['mangle'];
|
|
@@ -107,26 +108,21 @@ export interface ICommonReplaceOptions {
|
|
|
107
108
|
keepEOL?: boolean;
|
|
108
109
|
escapeMap?: Record<string, string>;
|
|
109
110
|
}
|
|
110
|
-
export
|
|
111
|
-
tagRegexp: RegExp;
|
|
112
|
-
attrRegexp: RegExp;
|
|
113
|
-
tag: string;
|
|
114
|
-
attrs: ItemOrItemArray<string | RegExp>;
|
|
115
|
-
};
|
|
116
|
-
export interface ITempleteHandlerOptions extends ICommonReplaceOptions {
|
|
111
|
+
export interface ITemplateHandlerOptions extends ICommonReplaceOptions {
|
|
117
112
|
customAttributesEntities?: ICustomAttributesEntities;
|
|
118
113
|
escapeMap?: Record<string, string>;
|
|
119
114
|
mangleContext?: IMangleScopeContext;
|
|
120
115
|
inlineWxs?: boolean;
|
|
121
116
|
jsHandler?: (rawSource: string, set: Set<string>) => GeneratorResult;
|
|
122
117
|
runtimeSet?: Set<string>;
|
|
118
|
+
disabledDefaultTemplateHandler?: boolean;
|
|
123
119
|
}
|
|
124
120
|
export type GlobOrFunctionMatchers = 'htmlMatcher' | 'cssMatcher' | 'jsMatcher' | 'mainCssChunkMatcher' | 'wxsMatcher';
|
|
125
121
|
export type InternalUserDefinedOptions = Required<Omit<UserDefinedOptions, GlobOrFunctionMatchers | 'supportCustomLengthUnitsPatch' | 'customReplaceDictionary'> & {
|
|
126
122
|
[K in GlobOrFunctionMatchers]: K extends 'mainCssChunkMatcher' ? (name: string, appType?: AppType) => boolean : (name: string) => boolean;
|
|
127
123
|
} & {
|
|
128
124
|
supportCustomLengthUnitsPatch: ILengthUnitsPatchOptions | false;
|
|
129
|
-
|
|
125
|
+
templateHandler: (rawSource: string, options?: ITemplateHandlerOptions) => string;
|
|
130
126
|
styleHandler: (rawSource: string, options: IStyleHandlerOptions) => string;
|
|
131
127
|
jsHandler: (rawSource: string, set: Set<string>) => GeneratorResult;
|
|
132
128
|
escapeMap: Record<string, string>;
|
package/dist/vite.js
CHANGED
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var options = require('./options-
|
|
6
|
-
var postcss = require('./postcss-
|
|
7
|
-
var defaults = require('./defaults-
|
|
5
|
+
var options = require('./options-43afee21.js');
|
|
6
|
+
var postcss = require('./postcss-4e99a8e8.js');
|
|
7
|
+
var defaults = require('./defaults-28cfeec8.js');
|
|
8
8
|
require('micromatch');
|
|
9
9
|
require('@babel/types');
|
|
10
10
|
require('@babel/generator');
|
|
11
11
|
require('@babel/parser');
|
|
12
12
|
require('@babel/traverse');
|
|
13
13
|
require('./replace.js');
|
|
14
|
-
require('
|
|
15
|
-
require('./shared-
|
|
14
|
+
require('@weapp-core/escape');
|
|
15
|
+
require('./shared-df9de23f.js');
|
|
16
|
+
require('@weapp-core/regex');
|
|
16
17
|
require('postcss');
|
|
17
18
|
require('@csstools/postcss-is-pseudo-class');
|
|
18
19
|
require('node:path');
|
|
@@ -27,7 +28,7 @@ function UnifiedViteWeappTailwindcssPlugin(options$1 = {}) {
|
|
|
27
28
|
options$1.customReplaceDictionary = 'simple';
|
|
28
29
|
}
|
|
29
30
|
const opts = options.getOptions(options$1);
|
|
30
|
-
const { disabled, onEnd, onLoad, onStart, onUpdate,
|
|
31
|
+
const { disabled, onEnd, onLoad, onStart, onUpdate, templateHandler, styleHandler, patch, jsHandler, mainCssChunkMatcher, appType, setMangleRuntimeSet } = opts;
|
|
31
32
|
if (disabled) {
|
|
32
33
|
return;
|
|
33
34
|
}
|
|
@@ -49,7 +50,7 @@ function UnifiedViteWeappTailwindcssPlugin(options$1 = {}) {
|
|
|
49
50
|
for (let i = 0; i < groupedEntries.html.length; i++) {
|
|
50
51
|
const [file, originalSource] = groupedEntries.html[i];
|
|
51
52
|
const oldVal = originalSource.source.toString();
|
|
52
|
-
originalSource.source =
|
|
53
|
+
originalSource.source = templateHandler(oldVal, {
|
|
53
54
|
runtimeSet
|
|
54
55
|
});
|
|
55
56
|
onUpdate(file, oldVal, originalSource.source);
|
package/dist/vite.mjs
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { g as getOptions, a as createTailwindcssPatcher } from './options-
|
|
2
|
-
import { v as vitePluginName } from './postcss-
|
|
3
|
-
import { g as getGroupedEntries } from './defaults-
|
|
1
|
+
import { g as getOptions, a as createTailwindcssPatcher } from './options-d8cb9e14.mjs';
|
|
2
|
+
import { v as vitePluginName } from './postcss-a551ddc0.mjs';
|
|
3
|
+
import { g as getGroupedEntries } from './defaults-702719e1.mjs';
|
|
4
4
|
import 'micromatch';
|
|
5
5
|
import '@babel/types';
|
|
6
6
|
import '@babel/generator';
|
|
7
7
|
import '@babel/parser';
|
|
8
8
|
import '@babel/traverse';
|
|
9
9
|
import './replace.mjs';
|
|
10
|
-
import '
|
|
11
|
-
import './shared-
|
|
10
|
+
import '@weapp-core/escape';
|
|
11
|
+
import './shared-fd149084.mjs';
|
|
12
|
+
import '@weapp-core/regex';
|
|
12
13
|
import 'postcss';
|
|
13
14
|
import '@csstools/postcss-is-pseudo-class';
|
|
14
15
|
import 'node:path';
|
|
@@ -23,7 +24,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
23
24
|
options.customReplaceDictionary = 'simple';
|
|
24
25
|
}
|
|
25
26
|
const opts = getOptions(options);
|
|
26
|
-
const { disabled, onEnd, onLoad, onStart, onUpdate,
|
|
27
|
+
const { disabled, onEnd, onLoad, onStart, onUpdate, templateHandler, styleHandler, patch, jsHandler, mainCssChunkMatcher, appType, setMangleRuntimeSet } = opts;
|
|
27
28
|
if (disabled) {
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
@@ -45,7 +46,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
45
46
|
for (let i = 0; i < groupedEntries.html.length; i++) {
|
|
46
47
|
const [file, originalSource] = groupedEntries.html[i];
|
|
47
48
|
const oldVal = originalSource.source.toString();
|
|
48
|
-
originalSource.source =
|
|
49
|
+
originalSource.source = templateHandler(oldVal, {
|
|
49
50
|
runtimeSet
|
|
50
51
|
});
|
|
51
52
|
onUpdate(file, oldVal, originalSource.source);
|
package/dist/webpack.js
CHANGED
|
@@ -4,17 +4,18 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var path = require('node:path');
|
|
6
6
|
var fs = require('node:fs');
|
|
7
|
-
var options = require('./options-
|
|
8
|
-
var postcss = require('./postcss-
|
|
9
|
-
var defaults = require('./defaults-
|
|
7
|
+
var options = require('./options-43afee21.js');
|
|
8
|
+
var postcss = require('./postcss-4e99a8e8.js');
|
|
9
|
+
var defaults = require('./defaults-28cfeec8.js');
|
|
10
10
|
require('micromatch');
|
|
11
11
|
require('@babel/types');
|
|
12
12
|
require('@babel/generator');
|
|
13
13
|
require('@babel/parser');
|
|
14
14
|
require('@babel/traverse');
|
|
15
15
|
require('./replace.js');
|
|
16
|
-
require('
|
|
17
|
-
require('./shared-
|
|
16
|
+
require('@weapp-core/escape');
|
|
17
|
+
require('./shared-df9de23f.js');
|
|
18
|
+
require('@weapp-core/regex');
|
|
18
19
|
require('postcss');
|
|
19
20
|
require('@csstools/postcss-is-pseudo-class');
|
|
20
21
|
require('semver');
|
|
@@ -36,7 +37,7 @@ class UnifiedWebpackPluginV5 {
|
|
|
36
37
|
this.appType = this.options.appType;
|
|
37
38
|
}
|
|
38
39
|
apply(compiler) {
|
|
39
|
-
const { mainCssChunkMatcher, disabled, onLoad, onUpdate, onEnd, onStart, styleHandler, patch,
|
|
40
|
+
const { mainCssChunkMatcher, disabled, onLoad, onUpdate, onEnd, onStart, styleHandler, patch, templateHandler, jsHandler, setMangleRuntimeSet } = this.options;
|
|
40
41
|
if (disabled) {
|
|
41
42
|
return;
|
|
42
43
|
}
|
|
@@ -80,7 +81,7 @@ class UnifiedWebpackPluginV5 {
|
|
|
80
81
|
for (let i = 0; i < groupedEntries.html.length; i++) {
|
|
81
82
|
const [file, originalSource] = groupedEntries.html[i];
|
|
82
83
|
const rawSource = originalSource.source().toString();
|
|
83
|
-
const wxml =
|
|
84
|
+
const wxml = templateHandler(rawSource, {
|
|
84
85
|
runtimeSet
|
|
85
86
|
});
|
|
86
87
|
const source = new ConcatSource(wxml);
|
package/dist/webpack.mjs
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import fs from 'node:fs';
|
|
3
|
-
import { g as getOptions, a as createTailwindcssPatcher } from './options-
|
|
4
|
-
import { a as pluginName } from './postcss-
|
|
5
|
-
import { g as getGroupedEntries } from './defaults-
|
|
3
|
+
import { g as getOptions, a as createTailwindcssPatcher } from './options-d8cb9e14.mjs';
|
|
4
|
+
import { a as pluginName } from './postcss-a551ddc0.mjs';
|
|
5
|
+
import { g as getGroupedEntries } from './defaults-702719e1.mjs';
|
|
6
6
|
import 'micromatch';
|
|
7
7
|
import '@babel/types';
|
|
8
8
|
import '@babel/generator';
|
|
9
9
|
import '@babel/parser';
|
|
10
10
|
import '@babel/traverse';
|
|
11
11
|
import './replace.mjs';
|
|
12
|
-
import '
|
|
13
|
-
import './shared-
|
|
12
|
+
import '@weapp-core/escape';
|
|
13
|
+
import './shared-fd149084.mjs';
|
|
14
|
+
import '@weapp-core/regex';
|
|
14
15
|
import 'postcss';
|
|
15
16
|
import '@csstools/postcss-is-pseudo-class';
|
|
16
17
|
import 'semver';
|
|
@@ -27,7 +28,7 @@ class UnifiedWebpackPluginV5 {
|
|
|
27
28
|
this.appType = this.options.appType;
|
|
28
29
|
}
|
|
29
30
|
apply(compiler) {
|
|
30
|
-
const { mainCssChunkMatcher, disabled, onLoad, onUpdate, onEnd, onStart, styleHandler, patch,
|
|
31
|
+
const { mainCssChunkMatcher, disabled, onLoad, onUpdate, onEnd, onStart, styleHandler, patch, templateHandler, jsHandler, setMangleRuntimeSet } = this.options;
|
|
31
32
|
if (disabled) {
|
|
32
33
|
return;
|
|
33
34
|
}
|
|
@@ -71,7 +72,7 @@ class UnifiedWebpackPluginV5 {
|
|
|
71
72
|
for (let i = 0; i < groupedEntries.html.length; i++) {
|
|
72
73
|
const [file, originalSource] = groupedEntries.html[i];
|
|
73
74
|
const rawSource = originalSource.source().toString();
|
|
74
|
-
const wxml =
|
|
75
|
+
const wxml = templateHandler(rawSource, {
|
|
75
76
|
runtimeSet
|
|
76
77
|
});
|
|
77
78
|
const source = new ConcatSource(wxml);
|
package/dist/wxml/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { replaceWxml } from './shared';
|
|
2
|
-
export { generateCode,
|
|
2
|
+
export { generateCode, templateHandler, templateReplacer, customTemplateHandler, createTemplateHandler, extractSource } from './utils';
|
package/dist/wxml/shared.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function replaceWxml(original: string, options?:
|
|
1
|
+
import { ITemplateHandlerOptions } from "../types";
|
|
2
|
+
export declare function replaceWxml(original: string, options?: ITemplateHandlerOptions): string;
|
package/dist/wxml/utils.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { RawSource,
|
|
2
|
-
export declare function generateCode(match: string, options?:
|
|
1
|
+
import type { RawSource, ITemplateHandlerOptions } from "../types";
|
|
2
|
+
export declare function generateCode(match: string, options?: ITemplateHandlerOptions): string;
|
|
3
3
|
export declare function extractSource(original: string): RawSource[];
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function
|
|
4
|
+
export declare function templateReplacer(original: string, options?: ITemplateHandlerOptions): string;
|
|
5
|
+
export declare function templateHandler(rawSource: string, options?: ITemplateHandlerOptions): string;
|
|
6
|
+
export declare function customTemplateHandler(rawSource: string, options: Required<ITemplateHandlerOptions>): string;
|
|
7
|
+
export declare function createTemplateHandler(options?: Omit<ITemplateHandlerOptions, 'runtimeSet'>): (rawSource: string, opt?: Pick<ITemplateHandlerOptions, 'runtimeSet'>) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.3",
|
|
4
4
|
"description": "把tailwindcss jit引擎,带给小程序开发者们\nbring tailwindcss jit engine to our miniprogram developers!",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -46,7 +46,8 @@
|
|
|
46
46
|
"typesVersions": {
|
|
47
47
|
"*": {
|
|
48
48
|
"*": [
|
|
49
|
-
"./dist/*"
|
|
49
|
+
"./dist/*",
|
|
50
|
+
"./dist/index.d.ts"
|
|
50
51
|
]
|
|
51
52
|
}
|
|
52
53
|
},
|
|
@@ -119,9 +120,9 @@
|
|
|
119
120
|
"@types/jest": "^29.5.3",
|
|
120
121
|
"@types/klaw": "^3.0.3",
|
|
121
122
|
"@types/loader-utils": "^2.0.3",
|
|
122
|
-
"@types/lodash": "^4.14.
|
|
123
|
+
"@types/lodash": "^4.14.196",
|
|
123
124
|
"@types/micromatch": "^4.0.2",
|
|
124
|
-
"@types/node": "^20.4.
|
|
125
|
+
"@types/node": "^20.4.5",
|
|
125
126
|
"@types/semver": "^7.5.0",
|
|
126
127
|
"@types/vinyl": "^2.0.7",
|
|
127
128
|
"@types/webpack": "^5.28.1",
|
|
@@ -130,17 +131,16 @@
|
|
|
130
131
|
"autoprefixer": "^10.4.14",
|
|
131
132
|
"babel-loader": "^9.1.3",
|
|
132
133
|
"bumpp": "^9.1.1",
|
|
133
|
-
"
|
|
134
|
+
"colorette": "^2.0.20",
|
|
134
135
|
"cross-env": "^7.0.3",
|
|
135
136
|
"css-loader": "^6.8.1",
|
|
136
137
|
"defu": "6.1.2",
|
|
137
|
-
"del": "^
|
|
138
|
+
"del": "^7.0.0",
|
|
138
139
|
"eslint": "8.45.0",
|
|
139
|
-
"eslint-config-icebreaker": "^1.
|
|
140
|
+
"eslint-config-icebreaker": "^1.2.2",
|
|
140
141
|
"eslint-config-prettier": "^8.8.0",
|
|
141
142
|
"eslint-plugin-prettier": "^4.2.1",
|
|
142
|
-
"
|
|
143
|
-
"fast-glob": "^3.3.0",
|
|
143
|
+
"fast-glob": "^3.3.1",
|
|
144
144
|
"fs-extra": "^11.1.1",
|
|
145
145
|
"gulp": "^4.0.2",
|
|
146
146
|
"gulp-postcss": "^9.0.1",
|
|
@@ -157,23 +157,23 @@
|
|
|
157
157
|
"postcss-rem-to-responsive-pixel": "^5.1.3",
|
|
158
158
|
"prettier": "^2.8.8",
|
|
159
159
|
"promisify-loader-runner": "^1.0.0",
|
|
160
|
-
"rollup": "^3.26.
|
|
160
|
+
"rollup": "^3.26.3",
|
|
161
161
|
"rollup-plugin-visualizer": "^5.9.2",
|
|
162
162
|
"style-loader": "^3.3.3",
|
|
163
163
|
"tailwind-children": "^0.5.0",
|
|
164
164
|
"tailwindcss": "^3.3.3",
|
|
165
165
|
"ts-jest": "^29.1.1",
|
|
166
166
|
"ts-node": "^10.9.1",
|
|
167
|
-
"ts-patch": "^3.0.
|
|
167
|
+
"ts-patch": "^3.0.2",
|
|
168
168
|
"tsd": "^0.28.1",
|
|
169
|
-
"tslib": "^2.6.
|
|
169
|
+
"tslib": "^2.6.1",
|
|
170
170
|
"typescript": "^5.1.6",
|
|
171
171
|
"typescript-transform-paths": "^3.4.6",
|
|
172
172
|
"vinyl": "^3.0.0",
|
|
173
|
-
"vite": "^4.4.
|
|
173
|
+
"vite": "^4.4.7",
|
|
174
174
|
"vitest": "^0.33.0",
|
|
175
175
|
"weapp-tailwindcss-children": "^0.1.0",
|
|
176
|
-
"webpack": "^5.88.
|
|
176
|
+
"webpack": "^5.88.2",
|
|
177
177
|
"webpack-build-utils": "^0.0.4"
|
|
178
178
|
},
|
|
179
179
|
"dependencies": {
|
|
@@ -182,15 +182,17 @@
|
|
|
182
182
|
"@babel/traverse": "^7.22.8",
|
|
183
183
|
"@babel/types": "^7.22.5",
|
|
184
184
|
"@csstools/postcss-is-pseudo-class": "^4.0.0",
|
|
185
|
+
"@weapp-core/escape": "^1.0.0",
|
|
186
|
+
"@weapp-core/regex": "^1.0.0",
|
|
185
187
|
"loader-utils": "^2.0.3",
|
|
186
188
|
"micromatch": "^4.0.5",
|
|
187
|
-
"postcss": "8.4.
|
|
189
|
+
"postcss": "8.4.27",
|
|
188
190
|
"postcss-selector-parser": "^6.0.13",
|
|
189
191
|
"semver": "^7.5.4",
|
|
190
|
-
"tailwindcss-mangle-shared": "^1.2.
|
|
191
|
-
"tailwindcss-patch": "^1.2.
|
|
192
|
+
"tailwindcss-mangle-shared": "^1.2.7",
|
|
193
|
+
"tailwindcss-patch": "^1.2.7"
|
|
192
194
|
},
|
|
193
|
-
"packageManager": "pnpm@8.6.
|
|
195
|
+
"packageManager": "pnpm@8.6.9",
|
|
194
196
|
"scripts": {
|
|
195
197
|
"dev": "yarn clean && yarn dts && cross-env NODE_ENV=development rollup -c rollup.config.ts --configPlugin typescript -w",
|
|
196
198
|
"build": "yarn clean && cross-env NODE_ENV=production rollup -c rollup.config.ts --configPlugin typescript && yarn dts",
|
package/dist/dic-05980807.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const SYMBOL_TABLE = {
|
|
4
|
-
BACKQUOTE: '`',
|
|
5
|
-
TILDE: '~',
|
|
6
|
-
EXCLAM: '!',
|
|
7
|
-
AT: '@',
|
|
8
|
-
NUMBERSIGN: '#',
|
|
9
|
-
DOLLAR: '$',
|
|
10
|
-
PERCENT: '%',
|
|
11
|
-
CARET: '^',
|
|
12
|
-
AMPERSAND: '&',
|
|
13
|
-
ASTERISK: '*',
|
|
14
|
-
PARENLEFT: '(',
|
|
15
|
-
PARENRIGHT: ')',
|
|
16
|
-
MINUS: '-',
|
|
17
|
-
UNDERSCORE: '_',
|
|
18
|
-
EQUAL: '=',
|
|
19
|
-
PLUS: '+',
|
|
20
|
-
BRACKETLEFT: '[',
|
|
21
|
-
BRACELEFT: '{',
|
|
22
|
-
BRACKETRIGHT: ']',
|
|
23
|
-
BRACERIGHT: '}',
|
|
24
|
-
SEMICOLON: ';',
|
|
25
|
-
COLON: ':',
|
|
26
|
-
QUOTE: "'",
|
|
27
|
-
DOUBLEQUOTE: '"',
|
|
28
|
-
BACKSLASH: '\\',
|
|
29
|
-
BAR: '|',
|
|
30
|
-
COMMA: ',',
|
|
31
|
-
LESS: '<',
|
|
32
|
-
PERIOD: '.',
|
|
33
|
-
GREATER: '>',
|
|
34
|
-
SLASH: '/',
|
|
35
|
-
QUESTION: '?',
|
|
36
|
-
SPACE: ' ',
|
|
37
|
-
DOT: '.',
|
|
38
|
-
HASH: '#'
|
|
39
|
-
};
|
|
40
|
-
const MappingChars2String = {
|
|
41
|
-
'[': '_bl_',
|
|
42
|
-
']': '_br_',
|
|
43
|
-
'(': '_pl_',
|
|
44
|
-
')': '_qr_',
|
|
45
|
-
'#': '_h_',
|
|
46
|
-
'!': '_i_',
|
|
47
|
-
'/': '_s_',
|
|
48
|
-
'\\': '_bs_',
|
|
49
|
-
'.': '_d_',
|
|
50
|
-
':': '_c_',
|
|
51
|
-
'%': '_p_',
|
|
52
|
-
',': '_co_',
|
|
53
|
-
"'": '_q_',
|
|
54
|
-
'"': '_dq_',
|
|
55
|
-
'*': '_a_',
|
|
56
|
-
'&': '_am_',
|
|
57
|
-
'@': '_at_',
|
|
58
|
-
'{': '_bal_',
|
|
59
|
-
'}': '_bar_',
|
|
60
|
-
'+': '_plus_',
|
|
61
|
-
';': '_se_',
|
|
62
|
-
'<': '_l_',
|
|
63
|
-
'~': '_t_',
|
|
64
|
-
'=': '_e_',
|
|
65
|
-
'>': '_g_',
|
|
66
|
-
'?': '_qu_',
|
|
67
|
-
'^': '_ca_',
|
|
68
|
-
'`': '_bq_',
|
|
69
|
-
'|': '_b_',
|
|
70
|
-
$: '_do_'
|
|
71
|
-
};
|
|
72
|
-
const MappingChars2StringEntries = Object.entries(MappingChars2String);
|
|
73
|
-
const SimpleMappingChars2String = {
|
|
74
|
-
'[': '_',
|
|
75
|
-
']': '_',
|
|
76
|
-
'(': '_',
|
|
77
|
-
')': '_',
|
|
78
|
-
'{': '_',
|
|
79
|
-
'}': '_',
|
|
80
|
-
'+': 'a',
|
|
81
|
-
',': 'b',
|
|
82
|
-
':': 'c',
|
|
83
|
-
'.': 'd',
|
|
84
|
-
'=': 'e',
|
|
85
|
-
';': 'f',
|
|
86
|
-
'>': 'g',
|
|
87
|
-
'#': 'h',
|
|
88
|
-
'!': 'i',
|
|
89
|
-
'@': 'j',
|
|
90
|
-
'^': 'k',
|
|
91
|
-
'<': 'l',
|
|
92
|
-
'*': 'm',
|
|
93
|
-
'&': 'n',
|
|
94
|
-
'?': 'o',
|
|
95
|
-
'%': 'p',
|
|
96
|
-
"'": 'q',
|
|
97
|
-
$: 'r',
|
|
98
|
-
'/': 's',
|
|
99
|
-
'~': 't',
|
|
100
|
-
'|': 'u',
|
|
101
|
-
'`': 'v',
|
|
102
|
-
'\\': 'w',
|
|
103
|
-
'"': 'x'
|
|
104
|
-
};
|
|
105
|
-
const SimpleMappingChars2StringEntries = Object.entries(SimpleMappingChars2String);
|
|
106
|
-
|
|
107
|
-
exports.MappingChars2String = MappingChars2String;
|
|
108
|
-
exports.MappingChars2StringEntries = MappingChars2StringEntries;
|
|
109
|
-
exports.SYMBOL_TABLE = SYMBOL_TABLE;
|
|
110
|
-
exports.SimpleMappingChars2String = SimpleMappingChars2String;
|
|
111
|
-
exports.SimpleMappingChars2StringEntries = SimpleMappingChars2StringEntries;
|