weapp-tailwindcss 2.11.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{gulp → bundlers/gulp}/index.d.ts +1 -1
- package/dist/{vite → bundlers/vite}/index.d.ts +1 -1
- package/dist/{webpack → bundlers/webpack}/BaseUnifiedPlugin/v5.d.ts +1 -1
- package/dist/cli.js +6 -6
- package/dist/cli.mjs +6 -6
- package/dist/core.js +6 -6
- package/dist/core.mjs +6 -6
- package/dist/css-macro/index.js +1 -1
- package/dist/css-macro/index.mjs +1 -1
- package/dist/{defaults-0O-zKoXE.js → defaults-QOAV8NSV.js} +10 -5
- package/dist/{defaults-dz6xGhOP.mjs → defaults-TZpmwtzd.mjs} +10 -6
- package/dist/defaults.js +2 -1
- package/dist/defaults.mjs +2 -1
- package/dist/{defu-VMJMz2AB.js → defu-KWuJnZLV.js} +1 -0
- package/dist/{defu-NLkZUlr9.mjs → defu-ms_ZBCiB.mjs} +1 -1
- package/dist/gulp.d.ts +1 -1
- package/dist/gulp.js +6 -6
- package/dist/gulp.mjs +6 -6
- package/dist/index.js +6 -6
- package/dist/index.mjs +6 -6
- package/dist/js/handlers.d.ts +0 -1
- package/dist/{options-lXV72tWf.js → options-_u-7p8aC.js} +89 -186
- package/dist/{options-M8pGfjj_.mjs → options-vyKfCeIO.mjs} +87 -185
- package/dist/postcss/plugin.d.ts +1 -0
- package/dist/postcss/shared.d.ts +1 -0
- package/dist/{postcss-W8i3cl5I.mjs → postcss-4kTT_aj1.mjs} +41 -45
- package/dist/{postcss-Et8j4ugT.js → postcss-sB1dQbYV.js} +41 -45
- package/dist/postcss.js +8 -2
- package/dist/postcss.mjs +3 -2
- package/dist/replace.js +1 -1
- package/dist/replace.mjs +1 -1
- package/dist/{shared-S0v7ZvWs.mjs → shared-0D5OOeXo.mjs} +10 -1
- package/dist/{shared-nXoJWFdz.js → shared-AxeHlAoJ.js} +10 -0
- package/dist/types.d.ts +15 -21
- package/dist/utils.d.ts +9 -0
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +6 -6
- package/dist/vite.mjs +6 -6
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +6 -6
- package/dist/webpack.mjs +6 -6
- package/package.json +26 -34
- /package/dist/{webpack → bundlers/webpack}/index.d.ts +0 -0
- /package/dist/{webpack → bundlers/webpack}/loaders/weapp-tw-runtime-loader.d.ts +0 -0
|
@@ -1,33 +1,28 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var selectorParser = require('postcss-selector-parser');
|
|
4
|
-
var shared = require('./shared-
|
|
4
|
+
var shared = require('./shared-AxeHlAoJ.js');
|
|
5
5
|
var postcss = require('postcss');
|
|
6
6
|
require('@csstools/postcss-is-pseudo-class');
|
|
7
|
+
require('postcss-rem-to-responsive-pixel');
|
|
7
8
|
|
|
8
9
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
10
|
|
|
10
11
|
var selectorParser__default = /*#__PURE__*/_interopDefaultCompat(selectorParser);
|
|
11
12
|
|
|
12
13
|
const createTransform = (rule, options) => {
|
|
13
|
-
const {
|
|
14
|
-
const replaceFlag = replaceUniversalSelectorWith !== false;
|
|
14
|
+
const { escapeMap, mangleContext, cssSelectorReplacement } = options;
|
|
15
15
|
const transform = (selectors) => {
|
|
16
16
|
selectors.walk((selector) => {
|
|
17
|
-
if (selector.type === 'universal') {
|
|
18
|
-
|
|
19
|
-
selector.value = replaceUniversalSelectorWith;
|
|
20
|
-
}
|
|
21
|
-
else if (cssSelectorReplacement && cssSelectorReplacement.universal) {
|
|
22
|
-
selector.value = cssSelectorReplacement.universal;
|
|
23
|
-
}
|
|
17
|
+
if (selector.type === 'universal' && cssSelectorReplacement && cssSelectorReplacement.universal) {
|
|
18
|
+
selector.value = shared.composeIsPseudo(cssSelectorReplacement.universal);
|
|
24
19
|
}
|
|
25
20
|
if (selector.type === 'selector') {
|
|
26
21
|
const node = selector.nodes.find((x) => x.type === 'pseudo' && x.value === ':hover');
|
|
27
22
|
node && selector.remove();
|
|
28
23
|
}
|
|
29
24
|
if (selector.type === 'pseudo' && selector.value === ':root' && cssSelectorReplacement && cssSelectorReplacement.root) {
|
|
30
|
-
selector.value = cssSelectorReplacement.root;
|
|
25
|
+
selector.value = shared.composeIsPseudo(cssSelectorReplacement.root);
|
|
31
26
|
}
|
|
32
27
|
if (selector.type === 'class') {
|
|
33
28
|
selector.value = shared.internalCssSelectorReplacer(selector.value, {
|
|
@@ -252,33 +247,35 @@ const initialNodes = cssVars.map((x) => {
|
|
|
252
247
|
});
|
|
253
248
|
const PATTERNS = [/:not\(template\)\s*~\s*:not\(template\)/.source, /:not\(\[hidden\]\)\s*~\s*:not\(\[hidden\]\)/.source].join('|');
|
|
254
249
|
const BROAD_MATCH_GLOBAL_REGEXP = new RegExp(PATTERNS, 'g');
|
|
255
|
-
function testIfVariablesScope(node, count =
|
|
250
|
+
function testIfVariablesScope(node, count = 2) {
|
|
256
251
|
if (/:?:before/.test(node.selector) && /:?:after/.test(node.selector)) {
|
|
257
|
-
|
|
258
|
-
|
|
252
|
+
const nodes = node.nodes;
|
|
253
|
+
let c = 0;
|
|
254
|
+
for (const tryTestDecl of nodes) {
|
|
259
255
|
if (tryTestDecl && tryTestDecl.type === 'decl' && tryTestDecl.prop.startsWith('--tw-')) {
|
|
260
|
-
|
|
256
|
+
c++;
|
|
261
257
|
}
|
|
262
|
-
|
|
263
|
-
return
|
|
258
|
+
if (c >= count) {
|
|
259
|
+
return true;
|
|
264
260
|
}
|
|
265
261
|
}
|
|
266
|
-
return
|
|
262
|
+
return false;
|
|
267
263
|
}
|
|
268
264
|
return false;
|
|
269
265
|
}
|
|
270
|
-
function testIfTwBackdrop(node, count =
|
|
266
|
+
function testIfTwBackdrop(node, count = 2) {
|
|
271
267
|
if (node.type === 'rule' && node.selector === '::backdrop') {
|
|
272
|
-
|
|
273
|
-
|
|
268
|
+
const nodes = node.nodes;
|
|
269
|
+
let c = 0;
|
|
270
|
+
for (const tryTestDecl of nodes) {
|
|
274
271
|
if (tryTestDecl && tryTestDecl.type === 'decl' && tryTestDecl.prop.startsWith('--tw-')) {
|
|
275
|
-
|
|
272
|
+
c++;
|
|
276
273
|
}
|
|
277
|
-
|
|
278
|
-
return
|
|
274
|
+
if (c >= count) {
|
|
275
|
+
return true;
|
|
279
276
|
}
|
|
280
277
|
}
|
|
281
|
-
return
|
|
278
|
+
return false;
|
|
282
279
|
}
|
|
283
280
|
return false;
|
|
284
281
|
}
|
|
@@ -293,27 +290,20 @@ function makePseudoVarRule() {
|
|
|
293
290
|
return pseudoVarRule;
|
|
294
291
|
}
|
|
295
292
|
function remakeCssVarSelector(selectors, cssPreflightRange) {
|
|
296
|
-
const idx = selectors.indexOf('*');
|
|
297
|
-
if (idx > -1) {
|
|
298
|
-
selectors.splice(idx, 1);
|
|
299
|
-
}
|
|
300
|
-
if (!selectors.includes('view')) {
|
|
301
|
-
selectors.push('view');
|
|
302
|
-
}
|
|
303
293
|
if (cssPreflightRange === 'all' &&
|
|
304
294
|
!selectors.includes(':not(not)')) {
|
|
305
295
|
selectors.push(':not(not)');
|
|
306
296
|
}
|
|
297
|
+
if (!selectors.includes('*')) {
|
|
298
|
+
selectors.unshift('*');
|
|
299
|
+
}
|
|
307
300
|
return selectors;
|
|
308
301
|
}
|
|
309
302
|
function remakeCombinatorSelector(selector, cssChildCombinatorReplaceValue) {
|
|
310
303
|
let childCombinatorReplaceValue = 'view + view';
|
|
311
|
-
if (Array.isArray(cssChildCombinatorReplaceValue)) {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
return x + ' + ' + x;
|
|
315
|
-
})
|
|
316
|
-
.join(',');
|
|
304
|
+
if (Array.isArray(cssChildCombinatorReplaceValue) && cssChildCombinatorReplaceValue.length > 0) {
|
|
305
|
+
const x = shared.composeIsPseudo(cssChildCombinatorReplaceValue);
|
|
306
|
+
childCombinatorReplaceValue = x + ' + ' + x;
|
|
317
307
|
}
|
|
318
308
|
else if (typeof cssChildCombinatorReplaceValue === 'string') {
|
|
319
309
|
childCombinatorReplaceValue = cssChildCombinatorReplaceValue;
|
|
@@ -331,7 +321,7 @@ function commonChunkPreflight(node, options) {
|
|
|
331
321
|
}
|
|
332
322
|
if (options.injectAdditionalCssVarScope && testIfTwBackdrop(node)) {
|
|
333
323
|
const syntheticRule = new postcss.Rule({
|
|
334
|
-
selectors: ['::after', '::before'],
|
|
324
|
+
selectors: ['*', '::after', '::before'],
|
|
335
325
|
nodes: initialNodes
|
|
336
326
|
});
|
|
337
327
|
syntheticRule.selectors = remakeCssVarSelector(syntheticRule.selectors, options.cssPreflightRange);
|
|
@@ -347,6 +337,9 @@ const postcssPlugin = 'postcss-weapp-tailwindcss-rename-plugin';
|
|
|
347
337
|
const pluginName = 'weapp-tailwindcss-webpack-plugin';
|
|
348
338
|
const vitePluginName = 'vite-plugin-uni-app-weapp-tailwindcss-adaptor';
|
|
349
339
|
|
|
340
|
+
function isAtMediaHover(atRule) {
|
|
341
|
+
return /media\(\s*hover\s*:\s*hover\s*\)/.test(atRule.name) || (atRule.name === 'media' && /\(\s*hover\s*:\s*hover\s*\)/.test(atRule.params));
|
|
342
|
+
}
|
|
350
343
|
const postcssWeappTailwindcss = (options = {
|
|
351
344
|
isMainChunk: true
|
|
352
345
|
}) => {
|
|
@@ -355,14 +348,17 @@ const postcssWeappTailwindcss = (options = {
|
|
|
355
348
|
return {
|
|
356
349
|
postcssPlugin,
|
|
357
350
|
Once(css) {
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
351
|
+
isMainChunk &&
|
|
352
|
+
css.walkRules((rule) => {
|
|
353
|
+
commonChunkPreflight(rule, options);
|
|
354
|
+
});
|
|
355
|
+
},
|
|
356
|
+
Rule(rule) {
|
|
357
|
+
transformSync(rule, options);
|
|
358
|
+
isCustomRuleCallbackFn && customRuleCallback(rule, options);
|
|
363
359
|
},
|
|
364
360
|
AtRule(atRule) {
|
|
365
|
-
if (
|
|
361
|
+
if (isAtMediaHover(atRule)) {
|
|
366
362
|
atRule.before(atRule.nodes);
|
|
367
363
|
atRule.remove();
|
|
368
364
|
}
|
package/dist/postcss.js
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var postcss = require('./postcss-
|
|
5
|
+
var postcss = require('./postcss-sB1dQbYV.js');
|
|
6
6
|
var postcssIsPseudoClass = require('@csstools/postcss-is-pseudo-class');
|
|
7
|
+
var postcssRem2rpx = require('postcss-rem-to-responsive-pixel');
|
|
7
8
|
require('postcss-selector-parser');
|
|
8
|
-
require('./shared-
|
|
9
|
+
require('./shared-AxeHlAoJ.js');
|
|
9
10
|
require('@weapp-core/escape');
|
|
10
11
|
require('@ast-core/escape');
|
|
11
12
|
require('postcss');
|
|
@@ -13,6 +14,7 @@ require('postcss');
|
|
|
13
14
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
15
|
|
|
15
16
|
var postcssIsPseudoClass__default = /*#__PURE__*/_interopDefaultCompat(postcssIsPseudoClass);
|
|
17
|
+
var postcssRem2rpx__default = /*#__PURE__*/_interopDefaultCompat(postcssRem2rpx);
|
|
16
18
|
|
|
17
19
|
|
|
18
20
|
|
|
@@ -21,3 +23,7 @@ Object.defineProperty(exports, 'postcssIsPseudoClass', {
|
|
|
21
23
|
enumerable: true,
|
|
22
24
|
get: function () { return postcssIsPseudoClass__default["default"]; }
|
|
23
25
|
});
|
|
26
|
+
Object.defineProperty(exports, 'postcssRem2rpx', {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function () { return postcssRem2rpx__default["default"]; }
|
|
29
|
+
});
|
package/dist/postcss.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { p as postcssWeappTailwindcss } from './postcss-
|
|
1
|
+
export { p as postcssWeappTailwindcss } from './postcss-4kTT_aj1.mjs';
|
|
2
2
|
export { default as postcssIsPseudoClass } from '@csstools/postcss-is-pseudo-class';
|
|
3
|
+
export { default as postcssRem2rpx } from 'postcss-rem-to-responsive-pixel';
|
|
3
4
|
import 'postcss-selector-parser';
|
|
4
|
-
import './shared-
|
|
5
|
+
import './shared-0D5OOeXo.mjs';
|
|
5
6
|
import '@weapp-core/escape';
|
|
6
7
|
import '@ast-core/escape';
|
|
7
8
|
import 'postcss';
|
package/dist/replace.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var escape = require('@weapp-core/escape');
|
|
6
6
|
require('@ast-core/escape');
|
|
7
|
-
var shared = require('./shared-
|
|
7
|
+
var shared = require('./shared-AxeHlAoJ.js');
|
|
8
8
|
|
|
9
9
|
function replaceWxml(original, options = {
|
|
10
10
|
keepEOL: false,
|
package/dist/replace.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { escape, SimpleMappingChars2String } from '@weapp-core/escape';
|
|
2
2
|
export { MappingChars2String, MappingChars2StringEntries, SYMBOL_TABLE, SimpleMappingChars2String, SimpleMappingChars2StringEntries } from '@weapp-core/escape';
|
|
3
3
|
import '@ast-core/escape';
|
|
4
|
-
export { i as replaceCss } from './shared-
|
|
4
|
+
export { i as replaceCss } from './shared-0D5OOeXo.mjs';
|
|
5
5
|
|
|
6
6
|
function replaceWxml(original, options = {
|
|
7
7
|
keepEOL: false,
|
|
@@ -12,5 +12,14 @@ function internalCssSelectorReplacer(selectors, options = {
|
|
|
12
12
|
map: escapeMap
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
+
function composeIsPseudo(strs) {
|
|
16
|
+
if (typeof strs === 'string') {
|
|
17
|
+
return strs;
|
|
18
|
+
}
|
|
19
|
+
if (strs.length > 1) {
|
|
20
|
+
return `:is(${strs.join(',')})`;
|
|
21
|
+
}
|
|
22
|
+
return strs.join('');
|
|
23
|
+
}
|
|
15
24
|
|
|
16
|
-
export { internalCssSelectorReplacer as i };
|
|
25
|
+
export { composeIsPseudo as c, internalCssSelectorReplacer as i };
|
|
@@ -14,5 +14,15 @@ function internalCssSelectorReplacer(selectors, options = {
|
|
|
14
14
|
map: escapeMap
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
+
function composeIsPseudo(strs) {
|
|
18
|
+
if (typeof strs === 'string') {
|
|
19
|
+
return strs;
|
|
20
|
+
}
|
|
21
|
+
if (strs.length > 1) {
|
|
22
|
+
return `:is(${strs.join(',')})`;
|
|
23
|
+
}
|
|
24
|
+
return strs.join('');
|
|
25
|
+
}
|
|
17
26
|
|
|
27
|
+
exports.composeIsPseudo = composeIsPseudo;
|
|
18
28
|
exports.internalCssSelectorReplacer = internalCssSelectorReplacer;
|
package/dist/types.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Rule } from 'postcss';
|
|
|
2
2
|
import type { IClassGeneratorOptions, ClassGenerator } from '@tailwindcss-mangle/shared';
|
|
3
3
|
import type { SourceMap } from 'magic-string';
|
|
4
4
|
import type { GeneratorResult } from '@babel/generator';
|
|
5
|
+
import type { UserDefinedOptions as rem2rpxOptions } from 'postcss-rem-to-responsive-pixel';
|
|
5
6
|
import type { InjectPreflight } from './postcss/preflight';
|
|
6
7
|
import type { ICreateCacheReturnType } from "./cache";
|
|
7
8
|
export type ItemOrItemArray<T> = T | T[];
|
|
@@ -18,7 +19,7 @@ export type RequiredStyleHandlerOptions = {
|
|
|
18
19
|
isMainChunk: boolean;
|
|
19
20
|
cssInjectPreflight?: InjectPreflight;
|
|
20
21
|
escapeMap?: Record<string, string>;
|
|
21
|
-
} & Pick<UserDefinedOptions, 'cssPreflightRange' | 'cssChildCombinatorReplaceValue' | '
|
|
22
|
+
} & Pick<UserDefinedOptions, 'cssPreflightRange' | 'cssChildCombinatorReplaceValue' | 'injectAdditionalCssVarScope' | 'cssSelectorReplacement' | 'rem2rpx'>;
|
|
22
23
|
export type CustomRuleCallback = (node: Rule, options: Readonly<RequiredStyleHandlerOptions>) => void;
|
|
23
24
|
export interface InternalCssSelectorReplacerOptions {
|
|
24
25
|
mangleContext?: IMangleScopeContext;
|
|
@@ -38,11 +39,9 @@ export type ICustomAttributesEntities = [string | RegExp, ItemOrItemArray<string
|
|
|
38
39
|
export type IJsHandlerOptions = {
|
|
39
40
|
escapeMap?: Record<string, string>;
|
|
40
41
|
classNameSet: Set<string>;
|
|
41
|
-
minifiedJs?: boolean;
|
|
42
42
|
arbitraryValues?: IArbitraryValues;
|
|
43
43
|
mangleContext?: IMangleScopeContext;
|
|
44
44
|
jsPreserveClass?: (keyword: string) => boolean | undefined;
|
|
45
|
-
strategy?: UserDefinedOptions['jsEscapeStrategy'];
|
|
46
45
|
needEscaped?: boolean;
|
|
47
46
|
generateMap?: boolean;
|
|
48
47
|
};
|
|
@@ -74,13 +73,12 @@ export interface IArbitraryValues {
|
|
|
74
73
|
allowDoubleQuotes?: boolean;
|
|
75
74
|
}
|
|
76
75
|
export interface UserDefinedOptions {
|
|
77
|
-
htmlMatcher?: (
|
|
78
|
-
cssMatcher?: (
|
|
79
|
-
jsMatcher?: (
|
|
80
|
-
mainCssChunkMatcher?: (
|
|
76
|
+
htmlMatcher?: (name: string) => boolean;
|
|
77
|
+
cssMatcher?: (name: string) => boolean;
|
|
78
|
+
jsMatcher?: (name: string) => boolean;
|
|
79
|
+
mainCssChunkMatcher?: (name: string, appType?: AppType) => boolean;
|
|
81
80
|
cssPreflight?: CssPreflightOptions;
|
|
82
|
-
cssPreflightRange?: '
|
|
83
|
-
replaceUniversalSelectorWith?: string | false;
|
|
81
|
+
cssPreflightRange?: 'all';
|
|
84
82
|
disabled?: boolean;
|
|
85
83
|
customRuleCallback?: CustomRuleCallback;
|
|
86
84
|
onLoad?: () => void;
|
|
@@ -88,25 +86,24 @@ export interface UserDefinedOptions {
|
|
|
88
86
|
onUpdate?: (filename: string, oldVal: string, newVal: string) => void;
|
|
89
87
|
onEnd?: () => void;
|
|
90
88
|
customAttributes?: ICustomAttributes;
|
|
91
|
-
customReplaceDictionary?: 'simple' |
|
|
92
|
-
supportCustomLengthUnitsPatch?: ILengthUnitsPatchOptions
|
|
89
|
+
customReplaceDictionary?: 'simple' | Record<string, string>;
|
|
90
|
+
supportCustomLengthUnitsPatch?: ILengthUnitsPatchOptions;
|
|
93
91
|
appType?: AppType;
|
|
94
|
-
minifiedJs?: boolean;
|
|
95
92
|
mangle?: boolean | IMangleOptions;
|
|
96
93
|
arbitraryValues?: IArbitraryValues;
|
|
97
94
|
cssChildCombinatorReplaceValue?: string | string[];
|
|
98
|
-
wxsMatcher?: (
|
|
95
|
+
wxsMatcher?: (name: string) => boolean;
|
|
99
96
|
inlineWxs?: boolean;
|
|
100
97
|
injectAdditionalCssVarScope?: boolean;
|
|
101
98
|
jsPreserveClass?: (keyword: string) => boolean | undefined;
|
|
102
99
|
disabledDefaultTemplateHandler?: boolean;
|
|
103
|
-
jsEscapeStrategy?: 'regenerate' | 'replace';
|
|
104
100
|
runtimeLoaderPath?: string;
|
|
105
101
|
cssSelectorReplacement?: {
|
|
106
|
-
root?: string | false;
|
|
107
|
-
universal?: string | false;
|
|
102
|
+
root?: string | string[] | false;
|
|
103
|
+
universal?: string | string[] | false;
|
|
108
104
|
};
|
|
109
105
|
tailwindcssBasedir?: string;
|
|
106
|
+
rem2rpx?: boolean | rem2rpxOptions;
|
|
110
107
|
}
|
|
111
108
|
export type JsHandler = (rawSource: string, set: Set<string>, options?: CreateJsHandlerOptions) => JsHandlerResult;
|
|
112
109
|
export interface IMangleScopeContext {
|
|
@@ -132,10 +129,7 @@ export interface ITemplateHandlerOptions extends ICommonReplaceOptions {
|
|
|
132
129
|
disabledDefaultTemplateHandler?: boolean;
|
|
133
130
|
quote?: string | null;
|
|
134
131
|
}
|
|
135
|
-
export type
|
|
136
|
-
export type InternalUserDefinedOptions = Required<Omit<UserDefinedOptions, GlobOrFunctionMatchers | 'supportCustomLengthUnitsPatch' | 'customReplaceDictionary'> & {
|
|
137
|
-
[K in GlobOrFunctionMatchers]: K extends 'mainCssChunkMatcher' ? (name: string, appType?: AppType) => boolean : (name: string) => boolean;
|
|
138
|
-
} & {
|
|
132
|
+
export type InternalUserDefinedOptions = Required<Omit<UserDefinedOptions, 'supportCustomLengthUnitsPatch' | 'customReplaceDictionary'> & {
|
|
139
133
|
supportCustomLengthUnitsPatch: ILengthUnitsPatchOptions | false;
|
|
140
134
|
templateHandler: (rawSource: string, options?: ITemplateHandlerOptions) => string;
|
|
141
135
|
styleHandler: (rawSource: string, options: IStyleHandlerOptions) => Promise<string>;
|
|
@@ -146,7 +140,7 @@ export type InternalUserDefinedOptions = Required<Omit<UserDefinedOptions, GlobO
|
|
|
146
140
|
setMangleRuntimeSet: (runtimeSet: Set<string>) => void;
|
|
147
141
|
cache: ICreateCacheReturnType;
|
|
148
142
|
}>;
|
|
149
|
-
export type InternalPostcssOptions = Pick<UserDefinedOptions, 'cssMatcher' | 'mainCssChunkMatcher' | 'cssPreflight' | '
|
|
143
|
+
export type InternalPostcssOptions = Pick<UserDefinedOptions, 'cssMatcher' | 'mainCssChunkMatcher' | 'cssPreflight' | 'cssPreflightRange' | 'customRuleCallback' | 'disabled'>;
|
|
150
144
|
export interface IBaseWebpackPlugin {
|
|
151
145
|
options: InternalUserDefinedOptions;
|
|
152
146
|
appType?: AppType;
|
package/dist/utils.d.ts
CHANGED
|
@@ -7,3 +7,12 @@ export declare function groupBy<T>(arr: T[], cb: (arg: T) => string): Record<str
|
|
|
7
7
|
export declare function getGroupedEntries<T>(entries: [string, T][], options: InternalUserDefinedOptions): Record<"css" | "html" | "js" | "other", [string, T][]>;
|
|
8
8
|
export declare function removeExt(file: string): string;
|
|
9
9
|
export { default as defu } from 'defu';
|
|
10
|
+
export declare const defuOverrideArray: <Source extends {
|
|
11
|
+
[x: string]: any;
|
|
12
|
+
[x: number]: any;
|
|
13
|
+
[x: symbol]: any;
|
|
14
|
+
}, Defaults extends ({
|
|
15
|
+
[x: string]: any;
|
|
16
|
+
[x: number]: any;
|
|
17
|
+
[x: symbol]: any;
|
|
18
|
+
} | (number | boolean | any[] | Record<never, any> | null | undefined))[]>(source: Source, ...defaults: Defaults) => import("defu").Defu<Source, Defaults>;
|
package/dist/vite.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './vite/index';
|
|
1
|
+
export * from './bundlers/vite/index';
|
package/dist/vite.js
CHANGED
|
@@ -2,25 +2,24 @@
|
|
|
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-_u-7p8aC.js');
|
|
6
|
+
var postcss = require('./postcss-sB1dQbYV.js');
|
|
7
|
+
var defaults = require('./defaults-QOAV8NSV.js');
|
|
8
8
|
var index = require('./index-z25r_Htj.js');
|
|
9
|
-
require('micromatch');
|
|
10
9
|
require('magic-string');
|
|
11
10
|
require('./replace.js');
|
|
12
11
|
require('@weapp-core/escape');
|
|
13
12
|
require('@ast-core/escape');
|
|
14
|
-
require('./shared-
|
|
13
|
+
require('./shared-AxeHlAoJ.js');
|
|
15
14
|
require('@weapp-core/regex');
|
|
16
15
|
require('@babel/generator');
|
|
17
16
|
require('@babel/parser');
|
|
18
17
|
require('@babel/traverse');
|
|
19
|
-
require('./defu-VMJMz2AB.js');
|
|
20
18
|
require('@babel/types');
|
|
21
19
|
require('htmlparser2');
|
|
22
20
|
require('postcss');
|
|
23
21
|
require('@csstools/postcss-is-pseudo-class');
|
|
22
|
+
require('postcss-rem-to-responsive-pixel');
|
|
24
23
|
require('node:path');
|
|
25
24
|
require('node:fs');
|
|
26
25
|
require('semver');
|
|
@@ -29,6 +28,7 @@ require('@tailwindcss-mangle/shared');
|
|
|
29
28
|
require('lru-cache');
|
|
30
29
|
require('md5');
|
|
31
30
|
require('postcss-selector-parser');
|
|
31
|
+
require('./defu-KWuJnZLV.js');
|
|
32
32
|
require('debug');
|
|
33
33
|
|
|
34
34
|
const debug = index.createDebug('generateBundle: ');
|
package/dist/vite.mjs
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { g as getOptions, a as createTailwindcssPatcher, _ as __awaiter } from './options-
|
|
2
|
-
import { v as vitePluginName } from './postcss-
|
|
3
|
-
import { g as getGroupedEntries } from './defaults-
|
|
1
|
+
import { g as getOptions, a as createTailwindcssPatcher, _ as __awaiter } from './options-vyKfCeIO.mjs';
|
|
2
|
+
import { v as vitePluginName } from './postcss-4kTT_aj1.mjs';
|
|
3
|
+
import { g as getGroupedEntries } from './defaults-TZpmwtzd.mjs';
|
|
4
4
|
import { c as createDebug } from './index-06BoOZig.mjs';
|
|
5
|
-
import 'micromatch';
|
|
6
5
|
import 'magic-string';
|
|
7
6
|
import './replace.mjs';
|
|
8
7
|
import '@weapp-core/escape';
|
|
9
8
|
import '@ast-core/escape';
|
|
10
|
-
import './shared-
|
|
9
|
+
import './shared-0D5OOeXo.mjs';
|
|
11
10
|
import '@weapp-core/regex';
|
|
12
11
|
import '@babel/generator';
|
|
13
12
|
import '@babel/parser';
|
|
14
13
|
import '@babel/traverse';
|
|
15
|
-
import './defu-NLkZUlr9.mjs';
|
|
16
14
|
import '@babel/types';
|
|
17
15
|
import 'htmlparser2';
|
|
18
16
|
import 'postcss';
|
|
19
17
|
import '@csstools/postcss-is-pseudo-class';
|
|
18
|
+
import 'postcss-rem-to-responsive-pixel';
|
|
20
19
|
import 'node:path';
|
|
21
20
|
import 'node:fs';
|
|
22
21
|
import 'semver';
|
|
@@ -25,6 +24,7 @@ import '@tailwindcss-mangle/shared';
|
|
|
25
24
|
import 'lru-cache';
|
|
26
25
|
import 'md5';
|
|
27
26
|
import 'postcss-selector-parser';
|
|
27
|
+
import './defu-ms_ZBCiB.mjs';
|
|
28
28
|
import 'debug';
|
|
29
29
|
|
|
30
30
|
const debug = createDebug('generateBundle: ');
|
package/dist/webpack.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './webpack/index';
|
|
1
|
+
export * from './bundlers/webpack/index';
|
package/dist/webpack.js
CHANGED
|
@@ -2,33 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var options = require('./options-
|
|
5
|
+
var options = require('./options-_u-7p8aC.js');
|
|
6
6
|
var path = require('node:path');
|
|
7
7
|
var fs = require('node:fs');
|
|
8
|
-
var postcss = require('./postcss-
|
|
9
|
-
var defaults = require('./defaults-
|
|
8
|
+
var postcss = require('./postcss-sB1dQbYV.js');
|
|
9
|
+
var defaults = require('./defaults-QOAV8NSV.js');
|
|
10
10
|
var index = require('./index-z25r_Htj.js');
|
|
11
|
-
require('micromatch');
|
|
12
11
|
require('magic-string');
|
|
13
12
|
require('./replace.js');
|
|
14
13
|
require('@weapp-core/escape');
|
|
15
14
|
require('@ast-core/escape');
|
|
16
|
-
require('./shared-
|
|
15
|
+
require('./shared-AxeHlAoJ.js');
|
|
17
16
|
require('@weapp-core/regex');
|
|
18
17
|
require('@babel/generator');
|
|
19
18
|
require('@babel/parser');
|
|
20
19
|
require('@babel/traverse');
|
|
21
|
-
require('./defu-VMJMz2AB.js');
|
|
22
20
|
require('@babel/types');
|
|
23
21
|
require('htmlparser2');
|
|
24
22
|
require('postcss');
|
|
25
23
|
require('@csstools/postcss-is-pseudo-class');
|
|
24
|
+
require('postcss-rem-to-responsive-pixel');
|
|
26
25
|
require('semver');
|
|
27
26
|
require('tailwindcss-patch');
|
|
28
27
|
require('@tailwindcss-mangle/shared');
|
|
29
28
|
require('lru-cache');
|
|
30
29
|
require('md5');
|
|
31
30
|
require('postcss-selector-parser');
|
|
31
|
+
require('./defu-KWuJnZLV.js');
|
|
32
32
|
require('debug');
|
|
33
33
|
|
|
34
34
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
package/dist/webpack.mjs
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { g as getOptions, a as createTailwindcssPatcher, _ as __awaiter } from './options-
|
|
1
|
+
import { g as getOptions, a as createTailwindcssPatcher, _ as __awaiter } from './options-vyKfCeIO.mjs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import fs from 'node:fs';
|
|
4
|
-
import { a as pluginName } from './postcss-
|
|
5
|
-
import { g as getGroupedEntries, r as removeExt } from './defaults-
|
|
4
|
+
import { a as pluginName } from './postcss-4kTT_aj1.mjs';
|
|
5
|
+
import { g as getGroupedEntries, r as removeExt } from './defaults-TZpmwtzd.mjs';
|
|
6
6
|
import { c as createDebug } from './index-06BoOZig.mjs';
|
|
7
|
-
import 'micromatch';
|
|
8
7
|
import 'magic-string';
|
|
9
8
|
import './replace.mjs';
|
|
10
9
|
import '@weapp-core/escape';
|
|
11
10
|
import '@ast-core/escape';
|
|
12
|
-
import './shared-
|
|
11
|
+
import './shared-0D5OOeXo.mjs';
|
|
13
12
|
import '@weapp-core/regex';
|
|
14
13
|
import '@babel/generator';
|
|
15
14
|
import '@babel/parser';
|
|
16
15
|
import '@babel/traverse';
|
|
17
|
-
import './defu-NLkZUlr9.mjs';
|
|
18
16
|
import '@babel/types';
|
|
19
17
|
import 'htmlparser2';
|
|
20
18
|
import 'postcss';
|
|
21
19
|
import '@csstools/postcss-is-pseudo-class';
|
|
20
|
+
import 'postcss-rem-to-responsive-pixel';
|
|
22
21
|
import 'semver';
|
|
23
22
|
import 'tailwindcss-patch';
|
|
24
23
|
import '@tailwindcss-mangle/shared';
|
|
25
24
|
import 'lru-cache';
|
|
26
25
|
import 'md5';
|
|
27
26
|
import 'postcss-selector-parser';
|
|
27
|
+
import './defu-ms_ZBCiB.mjs';
|
|
28
28
|
import 'debug';
|
|
29
29
|
|
|
30
30
|
const debug = createDebug('processAssets: ');
|