weapp-tailwindcss 3.8.0-alpha.2 → 4.0.0-alpha.4
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/{chunk-FQGZYB5X.mjs → chunk-3YZROAH3.mjs} +2 -2
- package/dist/{chunk-SLGPM54R.js → chunk-47WEZXZJ.js} +20 -27
- package/dist/{chunk-R3QJNUYU.js → chunk-6FNC3XMI.js} +1 -13
- package/dist/{chunk-KQ4TG7V3.js → chunk-6YX46GE5.js} +11 -11
- package/dist/{chunk-FSYVGTJO.mjs → chunk-AXBFBHS2.mjs} +0 -12
- package/dist/{chunk-WX3XJ7PY.js → chunk-EQEZ5FP7.js} +7 -7
- package/dist/{chunk-WNZKXLOB.mjs → chunk-EVOOS3HK.mjs} +2 -2
- package/dist/{chunk-IS6WLJ6U.mjs → chunk-GL4KIZ7G.mjs} +8 -15
- package/dist/{chunk-BY4T6WET.js → chunk-P5HAPIYK.js} +7 -7
- package/dist/{chunk-7BX3PGSW.mjs → chunk-QWPLYGM6.mjs} +2 -2
- package/dist/cli.js +4 -4
- package/dist/cli.mjs +2 -2
- package/dist/core.d.mts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +3 -3
- package/dist/core.mjs +2 -2
- package/dist/css-macro/postcss.js +1 -1
- package/dist/css-macro/postcss.mjs +1 -1
- package/dist/css-macro.js +1 -1
- package/dist/css-macro.mjs +1 -1
- package/dist/defaults.d.mts +2 -2
- package/dist/defaults.d.ts +2 -2
- package/dist/defaults.js +1 -1
- package/dist/defaults.mjs +1 -1
- package/dist/escape.d.mts +2 -2
- package/dist/escape.d.ts +2 -2
- package/dist/escape.js +1 -1
- package/dist/escape.mjs +1 -1
- package/dist/gulp.d.mts +2 -2
- package/dist/gulp.d.ts +2 -2
- package/dist/gulp.js +4 -4
- package/dist/gulp.mjs +3 -3
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -6
- package/dist/index.mjs +5 -5
- package/dist/types.d.mts +4 -4
- package/dist/types.d.ts +4 -4
- package/dist/vite.d.mts +2 -2
- package/dist/vite.d.ts +2 -2
- package/dist/vite.js +4 -4
- package/dist/vite.mjs +3 -3
- package/dist/weapp-tw-runtime-loader.js +1 -1
- package/dist/weapp-tw-runtime-loader.mjs +1 -1
- package/dist/webpack.d.mts +2 -2
- package/dist/webpack.d.ts +2 -2
- package/dist/webpack.js +4 -4
- package/dist/webpack.mjs +3 -3
- package/dist/webpack4.d.mts +2 -2
- package/dist/webpack4.d.ts +2 -2
- package/dist/webpack4.js +7 -7
- package/dist/webpack4.mjs +2 -2
- package/package.json +10 -11
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
} from "./chunk-L7PW3J3N.mjs";
|
|
7
7
|
import {
|
|
8
8
|
getOptions
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-GL4KIZ7G.mjs";
|
|
10
10
|
import {
|
|
11
11
|
getGroupedEntries,
|
|
12
12
|
removeExt
|
|
13
13
|
} from "./chunk-MUJ65IQ3.mjs";
|
|
14
14
|
import {
|
|
15
15
|
__async
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-AXBFBHS2.mjs";
|
|
17
17
|
|
|
18
18
|
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
19
19
|
import fs from "node:fs";
|
|
@@ -12,12 +12,15 @@ var _chunk35CYTBPMjs = require('./chunk-35CYTBPM.js');
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
var _chunkR3QJNUYUjs = require('./chunk-R3QJNUYU.js');
|
|
15
|
+
var _chunk6FNC3XMIjs = require('./chunk-6FNC3XMI.js');
|
|
17
16
|
|
|
18
17
|
// src/logger.ts
|
|
19
18
|
var _logger = require('@weapp-tailwindcss/logger');
|
|
20
19
|
|
|
20
|
+
// src/options.ts
|
|
21
|
+
var _mangle = require('@weapp-tailwindcss/mangle');
|
|
22
|
+
var _postcss = require('@weapp-tailwindcss/postcss');
|
|
23
|
+
|
|
21
24
|
// src/cache/index.ts
|
|
22
25
|
var _lrucache = require('lru-cache');
|
|
23
26
|
var _md5 = require('md5'); var _md52 = _interopRequireDefault(_md5);
|
|
@@ -73,7 +76,7 @@ function createCache(options) {
|
|
|
73
76
|
return instance.has(key);
|
|
74
77
|
},
|
|
75
78
|
process(key, callback, fallback) {
|
|
76
|
-
return
|
|
79
|
+
return _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
77
80
|
if (disabled) {
|
|
78
81
|
const res = yield fallback();
|
|
79
82
|
if (res) {
|
|
@@ -166,7 +169,7 @@ function replaceHandleValue(str, node, options, ms, offset = 0) {
|
|
|
166
169
|
|
|
167
170
|
// src/js/ast-grep.ts
|
|
168
171
|
function getAstGrep() {
|
|
169
|
-
return
|
|
172
|
+
return _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
170
173
|
try {
|
|
171
174
|
const mod = yield Promise.resolve().then(() => _interopRequireWildcard(require("@ast-grep/napi")));
|
|
172
175
|
return mod;
|
|
@@ -183,7 +186,7 @@ function isRangeWithinArray(ranges, targetRange) {
|
|
|
183
186
|
});
|
|
184
187
|
}
|
|
185
188
|
function astGrepUpdateString(ast, options, ms) {
|
|
186
|
-
return
|
|
189
|
+
return _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
187
190
|
var _a;
|
|
188
191
|
const { Lang, kind } = yield getAstGrep();
|
|
189
192
|
const callExpressionNodes = ast.findAll(kind(Lang.JavaScript, "call_expression"));
|
|
@@ -208,7 +211,7 @@ function astGrepUpdateString(ast, options, ms) {
|
|
|
208
211
|
end: range.end.index - 1,
|
|
209
212
|
start: range.start.index + 1
|
|
210
213
|
},
|
|
211
|
-
|
|
214
|
+
_chunk6FNC3XMIjs.__spreadProps.call(void 0, _chunk6FNC3XMIjs.__spreadValues.call(void 0, {}, options), {
|
|
212
215
|
unescapeUnicode: true
|
|
213
216
|
}),
|
|
214
217
|
ms,
|
|
@@ -237,7 +240,7 @@ function astGrepUpdateString(ast, options, ms) {
|
|
|
237
240
|
end: range.end.index,
|
|
238
241
|
start: range.start.index
|
|
239
242
|
},
|
|
240
|
-
|
|
243
|
+
_chunk6FNC3XMIjs.__spreadProps.call(void 0, _chunk6FNC3XMIjs.__spreadValues.call(void 0, {}, options), {
|
|
241
244
|
unescapeUnicode: true
|
|
242
245
|
}),
|
|
243
246
|
ms,
|
|
@@ -248,7 +251,7 @@ function astGrepUpdateString(ast, options, ms) {
|
|
|
248
251
|
});
|
|
249
252
|
}
|
|
250
253
|
function jsHandlerAsync(rawSource, options) {
|
|
251
|
-
return
|
|
254
|
+
return _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
252
255
|
const ms = new (0, _magicstring2.default)(rawSource);
|
|
253
256
|
const { parseAsync, Lang } = yield getAstGrep();
|
|
254
257
|
let ast;
|
|
@@ -316,7 +319,7 @@ function jsHandler(rawSource, options) {
|
|
|
316
319
|
replaceHandleValue(
|
|
317
320
|
n.value,
|
|
318
321
|
n,
|
|
319
|
-
|
|
322
|
+
_chunk6FNC3XMIjs.__spreadProps.call(void 0, _chunk6FNC3XMIjs.__spreadValues.call(void 0, {}, options), {
|
|
320
323
|
needEscaped: (_a = options.needEscaped) != null ? _a : true
|
|
321
324
|
}),
|
|
322
325
|
ms,
|
|
@@ -339,7 +342,7 @@ function jsHandler(rawSource, options) {
|
|
|
339
342
|
replaceHandleValue(
|
|
340
343
|
n.value.raw,
|
|
341
344
|
n,
|
|
342
|
-
|
|
345
|
+
_chunk6FNC3XMIjs.__spreadProps.call(void 0, _chunk6FNC3XMIjs.__spreadValues.call(void 0, {}, options), {
|
|
343
346
|
needEscaped: false
|
|
344
347
|
}),
|
|
345
348
|
ms,
|
|
@@ -354,7 +357,7 @@ function jsHandler(rawSource, options) {
|
|
|
354
357
|
p.traverse({
|
|
355
358
|
StringLiteral: {
|
|
356
359
|
enter(s) {
|
|
357
|
-
const res = jsHandler(s.node.value,
|
|
360
|
+
const res = jsHandler(s.node.value, _chunk6FNC3XMIjs.__spreadProps.call(void 0, _chunk6FNC3XMIjs.__spreadValues.call(void 0, {}, options), {
|
|
358
361
|
needEscaped: false,
|
|
359
362
|
generateMap: false
|
|
360
363
|
}));
|
|
@@ -373,7 +376,7 @@ function jsHandler(rawSource, options) {
|
|
|
373
376
|
},
|
|
374
377
|
TemplateElement: {
|
|
375
378
|
enter(s) {
|
|
376
|
-
const res = jsHandler(s.node.value.raw,
|
|
379
|
+
const res = jsHandler(s.node.value.raw, _chunk6FNC3XMIjs.__spreadProps.call(void 0, _chunk6FNC3XMIjs.__spreadValues.call(void 0, {}, options), {
|
|
377
380
|
generateMap: false
|
|
378
381
|
}));
|
|
379
382
|
if (res.code) {
|
|
@@ -463,16 +466,6 @@ function createJsHandler(options) {
|
|
|
463
466
|
return _jsHandler;
|
|
464
467
|
}
|
|
465
468
|
|
|
466
|
-
// src/mangle/index.ts
|
|
467
|
-
var mangle_exports = {};
|
|
468
|
-
_chunkR3QJNUYUjs.__reExport.call(void 0, mangle_exports, mangle_star);
|
|
469
|
-
var _mangle = require('@weapp-tailwindcss/mangle'); var mangle_star = _interopRequireWildcard(_mangle);
|
|
470
|
-
|
|
471
|
-
// src/postcss/index.ts
|
|
472
|
-
var postcss_exports = {};
|
|
473
|
-
_chunkR3QJNUYUjs.__reExport.call(void 0, postcss_exports, postcss_star);
|
|
474
|
-
var _postcss = require('@weapp-tailwindcss/postcss'); var postcss_star = _interopRequireWildcard(_postcss);
|
|
475
|
-
|
|
476
469
|
// src/tailwindcss/patcher.ts
|
|
477
470
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
478
471
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
@@ -725,7 +718,7 @@ function isPropsMatch(props, attr) {
|
|
|
725
718
|
}
|
|
726
719
|
}
|
|
727
720
|
function customTemplateHandler(rawSource, options) {
|
|
728
|
-
return
|
|
721
|
+
return _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
729
722
|
const {
|
|
730
723
|
customAttributesEntities = [],
|
|
731
724
|
disabledDefaultTemplateHandler,
|
|
@@ -751,7 +744,7 @@ function customTemplateHandler(rawSource, options) {
|
|
|
751
744
|
// htmlparser2 9.1.0: parser.endIndex - 1
|
|
752
745
|
// https://github.com/sonofmagic/weapp-tailwindcss/issues/269
|
|
753
746
|
parser.endIndex - 1,
|
|
754
|
-
templateReplacer(value,
|
|
747
|
+
templateReplacer(value, _chunk6FNC3XMIjs.__spreadProps.call(void 0, _chunk6FNC3XMIjs.__spreadValues.call(void 0, {}, options), {
|
|
755
748
|
quote
|
|
756
749
|
}))
|
|
757
750
|
);
|
|
@@ -841,11 +834,11 @@ function getOptions(opts) {
|
|
|
841
834
|
ignoreCallExpressionIdentifiers,
|
|
842
835
|
ignoreTaggedTemplateExpressionIdentifiers
|
|
843
836
|
} = result;
|
|
844
|
-
const cssInjectPreflight = (0,
|
|
837
|
+
const cssInjectPreflight = _postcss.createInjectPreflight.call(void 0, cssPreflight);
|
|
845
838
|
const customAttributesEntities = _chunk35CYTBPMjs.isMap.call(void 0, customAttributes) ? [...customAttributes.entries()] : Object.entries(customAttributes);
|
|
846
|
-
const { initMangle, mangleContext, setMangleRuntimeSet } = (0,
|
|
839
|
+
const { initMangle, mangleContext, setMangleRuntimeSet } = _mangle.useMangleStore.call(void 0, );
|
|
847
840
|
initMangle(mangle);
|
|
848
|
-
const styleHandler = (0,
|
|
841
|
+
const styleHandler = _postcss.createStyleHandler.call(void 0, {
|
|
849
842
|
cssInjectPreflight,
|
|
850
843
|
customRuleCallback,
|
|
851
844
|
cssPreflightRange,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var __defProp = Object.defineProperty;
|
|
2
2
|
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -19,15 +17,6 @@ var __spreadValues = (a, b) => {
|
|
|
19
17
|
return a;
|
|
20
18
|
};
|
|
21
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
|
-
var __copyProps = (to, from, except, desc) => {
|
|
23
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
24
|
-
for (let key of __getOwnPropNames(from))
|
|
25
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
26
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
27
|
-
}
|
|
28
|
-
return to;
|
|
29
|
-
};
|
|
30
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
31
20
|
var __async = (__this, __arguments, generator) => {
|
|
32
21
|
return new Promise((resolve, reject) => {
|
|
33
22
|
var fulfilled = (value) => {
|
|
@@ -53,5 +42,4 @@ var __async = (__this, __arguments, generator) => {
|
|
|
53
42
|
|
|
54
43
|
|
|
55
44
|
|
|
56
|
-
|
|
57
|
-
exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__reExport = __reExport; exports.__async = __async;
|
|
45
|
+
exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__async = __async;
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
var _chunkHBQASQKYjs = require('./chunk-HBQASQKY.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk47WEZXZJjs = require('./chunk-47WEZXZJ.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunk6FNC3XMIjs = require('./chunk-6FNC3XMI.js');
|
|
11
11
|
|
|
12
12
|
// src/bundlers/gulp/index.ts
|
|
13
13
|
var _buffer = require('buffer');
|
|
@@ -15,7 +15,7 @@ var _stream = require('stream'); var _stream2 = _interopRequireDefault(_stream);
|
|
|
15
15
|
var debug = _chunkHBQASQKYjs.createDebug.call(void 0, );
|
|
16
16
|
var Transform = _stream2.default.Transform;
|
|
17
17
|
function createPlugins(options = {}) {
|
|
18
|
-
const opts =
|
|
18
|
+
const opts = _chunk47WEZXZJjs.getOptions.call(void 0, options);
|
|
19
19
|
const { templateHandler, styleHandler, patch, jsHandler, setMangleRuntimeSet, cache, twPatcher } = opts;
|
|
20
20
|
let runtimeSet = /* @__PURE__ */ new Set();
|
|
21
21
|
patch == null ? void 0 : patch();
|
|
@@ -23,7 +23,7 @@ function createPlugins(options = {}) {
|
|
|
23
23
|
return new Transform({
|
|
24
24
|
objectMode: true,
|
|
25
25
|
transform(file, _encoding, callback) {
|
|
26
|
-
return
|
|
26
|
+
return _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
27
27
|
runtimeSet = twPatcher.getClassSet();
|
|
28
28
|
setMangleRuntimeSet(runtimeSet);
|
|
29
29
|
const error = null;
|
|
@@ -42,8 +42,8 @@ function createPlugins(options = {}) {
|
|
|
42
42
|
return false;
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
|
-
() =>
|
|
46
|
-
const { css } = yield styleHandler(rawSource,
|
|
45
|
+
() => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
46
|
+
const { css } = yield styleHandler(rawSource, _chunk6FNC3XMIjs.__spreadValues.call(void 0, {
|
|
47
47
|
isMainChunk: true
|
|
48
48
|
}, options2));
|
|
49
49
|
file.contents = _buffer.Buffer.from(css);
|
|
@@ -68,7 +68,7 @@ function createPlugins(options = {}) {
|
|
|
68
68
|
return new Transform({
|
|
69
69
|
objectMode: true,
|
|
70
70
|
transform(file, _encoding, callback) {
|
|
71
|
-
return
|
|
71
|
+
return _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
72
72
|
const error = null;
|
|
73
73
|
if (file.contents) {
|
|
74
74
|
const rawSource = file.contents.toString();
|
|
@@ -85,7 +85,7 @@ function createPlugins(options = {}) {
|
|
|
85
85
|
return false;
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
|
-
() =>
|
|
88
|
+
() => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
89
89
|
const { code } = yield jsHandler(rawSource, runtimeSet, options2);
|
|
90
90
|
file.contents = _buffer.Buffer.from(code);
|
|
91
91
|
debug("js handle: %s", file.path);
|
|
@@ -105,7 +105,7 @@ function createPlugins(options = {}) {
|
|
|
105
105
|
return new Transform({
|
|
106
106
|
objectMode: true,
|
|
107
107
|
transform(file, _encoding, callback) {
|
|
108
|
-
return
|
|
108
|
+
return _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
109
109
|
const error = null;
|
|
110
110
|
if (file.contents) {
|
|
111
111
|
const rawSource = file.contents.toString();
|
|
@@ -122,8 +122,8 @@ function createPlugins(options = {}) {
|
|
|
122
122
|
return false;
|
|
123
123
|
}
|
|
124
124
|
},
|
|
125
|
-
() =>
|
|
126
|
-
const code = yield templateHandler(rawSource,
|
|
125
|
+
() => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
126
|
+
const code = yield templateHandler(rawSource, _chunk6FNC3XMIjs.__spreadValues.call(void 0, {
|
|
127
127
|
runtimeSet
|
|
128
128
|
}, options2));
|
|
129
129
|
file.contents = _buffer.Buffer.from(code);
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -19,15 +17,6 @@ var __spreadValues = (a, b) => {
|
|
|
19
17
|
return a;
|
|
20
18
|
};
|
|
21
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
|
-
var __copyProps = (to, from, except, desc) => {
|
|
23
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
24
|
-
for (let key of __getOwnPropNames(from))
|
|
25
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
26
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
27
|
-
}
|
|
28
|
-
return to;
|
|
29
|
-
};
|
|
30
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
31
20
|
var __async = (__this, __arguments, generator) => {
|
|
32
21
|
return new Promise((resolve, reject) => {
|
|
33
22
|
var fulfilled = (value) => {
|
|
@@ -52,6 +41,5 @@ var __async = (__this, __arguments, generator) => {
|
|
|
52
41
|
export {
|
|
53
42
|
__spreadValues,
|
|
54
43
|
__spreadProps,
|
|
55
|
-
__reExport,
|
|
56
44
|
__async
|
|
57
45
|
};
|
|
@@ -6,14 +6,14 @@ var _chunkHBQASQKYjs = require('./chunk-HBQASQKY.js');
|
|
|
6
6
|
var _chunkEHEK77ROjs = require('./chunk-EHEK77RO.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunk47WEZXZJjs = require('./chunk-47WEZXZJ.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunk35CYTBPMjs = require('./chunk-35CYTBPM.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunk6FNC3XMIjs = require('./chunk-6FNC3XMI.js');
|
|
17
17
|
|
|
18
18
|
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
19
19
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
@@ -21,7 +21,7 @@ var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
|
21
21
|
var debug = _chunkHBQASQKYjs.createDebug.call(void 0, );
|
|
22
22
|
var UnifiedWebpackPluginV5 = class {
|
|
23
23
|
constructor(options = {}) {
|
|
24
|
-
this.options =
|
|
24
|
+
this.options = _chunk47WEZXZJjs.getOptions.call(void 0, options);
|
|
25
25
|
this.appType = this.options.appType;
|
|
26
26
|
}
|
|
27
27
|
apply(compiler) {
|
|
@@ -75,7 +75,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
75
75
|
name: _chunkEHEK77ROjs.pluginName,
|
|
76
76
|
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
77
77
|
},
|
|
78
|
-
(assets) =>
|
|
78
|
+
(assets) => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
79
79
|
onStart();
|
|
80
80
|
debug("start");
|
|
81
81
|
for (const chunk of compilation.chunks) {
|
|
@@ -107,7 +107,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
107
107
|
return false;
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
|
-
() =>
|
|
110
|
+
() => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
111
111
|
const wxml = yield templateHandler(rawSource, {
|
|
112
112
|
runtimeSet
|
|
113
113
|
});
|
|
@@ -141,7 +141,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
141
141
|
return false;
|
|
142
142
|
}
|
|
143
143
|
},
|
|
144
|
-
() =>
|
|
144
|
+
() => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
145
145
|
const rawSource = originalSource.source().toString();
|
|
146
146
|
const mapFilename = `${file}.map`;
|
|
147
147
|
const hasMap = Boolean(assets[mapFilename]);
|
|
@@ -185,7 +185,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
185
185
|
return false;
|
|
186
186
|
}
|
|
187
187
|
},
|
|
188
|
-
() =>
|
|
188
|
+
() => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
189
189
|
const { css } = yield styleHandler(rawSource, {
|
|
190
190
|
isMainChunk: mainCssChunkMatcher(file, this.appType)
|
|
191
191
|
});
|
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
} from "./chunk-L7PW3J3N.mjs";
|
|
7
7
|
import {
|
|
8
8
|
getOptions
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-GL4KIZ7G.mjs";
|
|
10
10
|
import {
|
|
11
11
|
getGroupedEntries
|
|
12
12
|
} from "./chunk-MUJ65IQ3.mjs";
|
|
13
13
|
import {
|
|
14
14
|
__async
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-AXBFBHS2.mjs";
|
|
16
16
|
|
|
17
17
|
// src/bundlers/vite/index.ts
|
|
18
18
|
var debug = createDebug();
|
|
@@ -10,14 +10,17 @@ import {
|
|
|
10
10
|
} from "./chunk-MUJ65IQ3.mjs";
|
|
11
11
|
import {
|
|
12
12
|
__async,
|
|
13
|
-
__reExport,
|
|
14
13
|
__spreadProps,
|
|
15
14
|
__spreadValues
|
|
16
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-AXBFBHS2.mjs";
|
|
17
16
|
|
|
18
17
|
// src/logger.ts
|
|
19
18
|
import { logger } from "@weapp-tailwindcss/logger";
|
|
20
19
|
|
|
20
|
+
// src/options.ts
|
|
21
|
+
import { useMangleStore } from "@weapp-tailwindcss/mangle";
|
|
22
|
+
import { createInjectPreflight, createStyleHandler } from "@weapp-tailwindcss/postcss";
|
|
23
|
+
|
|
21
24
|
// src/cache/index.ts
|
|
22
25
|
import { LRUCache } from "lru-cache";
|
|
23
26
|
import md5 from "md5";
|
|
@@ -463,16 +466,6 @@ function createJsHandler(options) {
|
|
|
463
466
|
return _jsHandler;
|
|
464
467
|
}
|
|
465
468
|
|
|
466
|
-
// src/mangle/index.ts
|
|
467
|
-
var mangle_exports = {};
|
|
468
|
-
__reExport(mangle_exports, mangle_star);
|
|
469
|
-
import * as mangle_star from "@weapp-tailwindcss/mangle";
|
|
470
|
-
|
|
471
|
-
// src/postcss/index.ts
|
|
472
|
-
var postcss_exports = {};
|
|
473
|
-
__reExport(postcss_exports, postcss_star);
|
|
474
|
-
import * as postcss_star from "@weapp-tailwindcss/postcss";
|
|
475
|
-
|
|
476
469
|
// src/tailwindcss/patcher.ts
|
|
477
470
|
import path from "node:path";
|
|
478
471
|
import process from "node:process";
|
|
@@ -841,11 +834,11 @@ function getOptions(opts) {
|
|
|
841
834
|
ignoreCallExpressionIdentifiers,
|
|
842
835
|
ignoreTaggedTemplateExpressionIdentifiers
|
|
843
836
|
} = result;
|
|
844
|
-
const cssInjectPreflight =
|
|
837
|
+
const cssInjectPreflight = createInjectPreflight(cssPreflight);
|
|
845
838
|
const customAttributesEntities = isMap(customAttributes) ? [...customAttributes.entries()] : Object.entries(customAttributes);
|
|
846
|
-
const { initMangle, mangleContext, setMangleRuntimeSet } =
|
|
839
|
+
const { initMangle, mangleContext, setMangleRuntimeSet } = useMangleStore();
|
|
847
840
|
initMangle(mangle);
|
|
848
|
-
const styleHandler =
|
|
841
|
+
const styleHandler = createStyleHandler({
|
|
849
842
|
cssInjectPreflight,
|
|
850
843
|
customRuleCallback,
|
|
851
844
|
cssPreflightRange,
|
|
@@ -6,18 +6,18 @@ var _chunkHBQASQKYjs = require('./chunk-HBQASQKY.js');
|
|
|
6
6
|
var _chunkEHEK77ROjs = require('./chunk-EHEK77RO.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunk47WEZXZJjs = require('./chunk-47WEZXZJ.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunk35CYTBPMjs = require('./chunk-35CYTBPM.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunk6FNC3XMIjs = require('./chunk-6FNC3XMI.js');
|
|
16
16
|
|
|
17
17
|
// src/bundlers/vite/index.ts
|
|
18
18
|
var debug = _chunkHBQASQKYjs.createDebug.call(void 0, );
|
|
19
19
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
20
|
-
const opts =
|
|
20
|
+
const opts = _chunk47WEZXZJjs.getOptions.call(void 0, options);
|
|
21
21
|
const {
|
|
22
22
|
disabled,
|
|
23
23
|
onEnd,
|
|
@@ -43,7 +43,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
43
43
|
name: _chunkEHEK77ROjs.vitePluginName,
|
|
44
44
|
enforce: "post",
|
|
45
45
|
generateBundle(_opt, bundle) {
|
|
46
|
-
return
|
|
46
|
+
return _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
47
47
|
debug("start");
|
|
48
48
|
onStart();
|
|
49
49
|
const entries = Object.entries(bundle);
|
|
@@ -69,7 +69,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
69
69
|
return false;
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
|
-
() =>
|
|
72
|
+
() => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
73
73
|
originalSource.source = yield templateHandler(oldVal, {
|
|
74
74
|
runtimeSet
|
|
75
75
|
});
|
|
@@ -103,7 +103,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
103
103
|
return false;
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
|
-
() =>
|
|
106
|
+
() => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
107
107
|
const mapFilename = `${file}.map`;
|
|
108
108
|
const hasMap = Boolean(bundle[mapFilename]);
|
|
109
109
|
const { code, map } = yield jsHandler(rawSource, runtimeSet, {
|
|
@@ -144,7 +144,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
144
144
|
return false;
|
|
145
145
|
}
|
|
146
146
|
},
|
|
147
|
-
() =>
|
|
147
|
+
() => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
148
148
|
const { css } = yield styleHandler(rawSource, {
|
|
149
149
|
isMainChunk: mainCssChunkMatcher(originalSource.fileName, appType)
|
|
150
150
|
});
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
} from "./chunk-75EWCRQW.mjs";
|
|
4
4
|
import {
|
|
5
5
|
getOptions
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GL4KIZ7G.mjs";
|
|
7
7
|
import {
|
|
8
8
|
__async,
|
|
9
9
|
__spreadValues
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-AXBFBHS2.mjs";
|
|
11
11
|
|
|
12
12
|
// src/bundlers/gulp/index.ts
|
|
13
13
|
import { Buffer } from "node:buffer";
|
package/dist/cli.js
CHANGED
|
@@ -4,11 +4,11 @@ var _chunkEHEK77ROjs = require('./chunk-EHEK77RO.js');
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunk47WEZXZJjs = require('./chunk-47WEZXZJ.js');
|
|
8
8
|
require('./chunk-RFNUATFD.js');
|
|
9
9
|
require('./chunk-NXBCP4JC.js');
|
|
10
10
|
require('./chunk-35CYTBPM.js');
|
|
11
|
-
require('./chunk-
|
|
11
|
+
require('./chunk-6FNC3XMI.js');
|
|
12
12
|
|
|
13
13
|
// src/cli.ts
|
|
14
14
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
@@ -17,13 +17,13 @@ var _semver = require('semver'); var _semver2 = _interopRequireDefault(_semver);
|
|
|
17
17
|
_process2.default.title = "node (weapp-tailwindcss)";
|
|
18
18
|
var args = _process2.default.argv.slice(2);
|
|
19
19
|
if (_semver2.default.lt(_process2.default.versions.node, _chunkEHEK77ROjs.WEAPP_TW_REQUIRED_NODE_VERSION)) {
|
|
20
|
-
|
|
20
|
+
_chunk47WEZXZJjs.logger.warn(
|
|
21
21
|
`You are using Node.js ${_process2.default.versions.node}. For weapp-tailwindcss, Node.js version >= v${_chunkEHEK77ROjs.WEAPP_TW_REQUIRED_NODE_VERSION} is required.`
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
24
|
var command = args[0];
|
|
25
25
|
if (command === "patch") {
|
|
26
|
-
const options =
|
|
26
|
+
const options = _chunk47WEZXZJjs.getOptions.call(void 0, );
|
|
27
27
|
options.patch();
|
|
28
28
|
} else if (command === "init") {
|
|
29
29
|
_init.init.call(void 0, );
|
package/dist/cli.mjs
CHANGED
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
getOptions,
|
|
6
6
|
logger
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-GL4KIZ7G.mjs";
|
|
8
8
|
import "./chunk-U7O2XXYR.mjs";
|
|
9
9
|
import "./chunk-Y4JDXXJ2.mjs";
|
|
10
10
|
import "./chunk-MUJ65IQ3.mjs";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-AXBFBHS2.mjs";
|
|
12
12
|
|
|
13
13
|
// src/cli.ts
|
|
14
14
|
import process from "node:process";
|
package/dist/core.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { UserDefinedOptions, ITemplateHandlerOptions, CreateJsHandlerOptions, JsHandlerResult } from './types.mjs';
|
|
2
2
|
import * as postcss from 'postcss';
|
|
3
|
-
import { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss
|
|
3
|
+
import { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
|
|
4
4
|
import '@babel/generator';
|
|
5
5
|
import '@babel/parser';
|
|
6
|
-
import '@weapp-tailwindcss/mangle
|
|
6
|
+
import '@weapp-tailwindcss/mangle';
|
|
7
7
|
import 'magic-string';
|
|
8
8
|
import 'tailwindcss-patch';
|
|
9
9
|
import 'node:buffer';
|
package/dist/core.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { UserDefinedOptions, ITemplateHandlerOptions, CreateJsHandlerOptions, JsHandlerResult } from './types.js';
|
|
2
2
|
import * as postcss from 'postcss';
|
|
3
|
-
import { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss
|
|
3
|
+
import { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
|
|
4
4
|
import '@babel/generator';
|
|
5
5
|
import '@babel/parser';
|
|
6
|
-
import '@weapp-tailwindcss/mangle
|
|
6
|
+
import '@weapp-tailwindcss/mangle';
|
|
7
7
|
import 'magic-string';
|
|
8
8
|
import 'tailwindcss-patch';
|
|
9
9
|
import 'node:buffer';
|
package/dist/core.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk47WEZXZJjs = require('./chunk-47WEZXZJ.js');
|
|
4
4
|
require('./chunk-RFNUATFD.js');
|
|
5
5
|
require('./chunk-NXBCP4JC.js');
|
|
6
6
|
require('./chunk-35CYTBPM.js');
|
|
7
|
-
require('./chunk-
|
|
7
|
+
require('./chunk-6FNC3XMI.js');
|
|
8
8
|
|
|
9
9
|
// src/core.ts
|
|
10
10
|
function createContext(options = {}) {
|
|
11
|
-
const opts =
|
|
11
|
+
const opts = _chunk47WEZXZJjs.getOptions.call(void 0, options);
|
|
12
12
|
const { templateHandler, styleHandler, patch, jsHandler, twPatcher } = opts;
|
|
13
13
|
let runtimeSet = /* @__PURE__ */ new Set();
|
|
14
14
|
patch == null ? void 0 : patch();
|
package/dist/core.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getOptions
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GL4KIZ7G.mjs";
|
|
4
4
|
import "./chunk-U7O2XXYR.mjs";
|
|
5
5
|
import "./chunk-Y4JDXXJ2.mjs";
|
|
6
6
|
import "./chunk-MUJ65IQ3.mjs";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-AXBFBHS2.mjs";
|
|
8
8
|
|
|
9
9
|
// src/core.ts
|
|
10
10
|
function createContext(options = {}) {
|
package/dist/css-macro.js
CHANGED
|
@@ -5,7 +5,7 @@ var _chunk6Z776ZWKjs = require('./chunk-6Z776ZWK.js');
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunk35CYTBPMjs = require('./chunk-35CYTBPM.js');
|
|
8
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-6FNC3XMI.js');
|
|
9
9
|
|
|
10
10
|
// src/css-macro/index.ts
|
|
11
11
|
var _plugin = require('tailwindcss/plugin'); var _plugin2 = _interopRequireDefault(_plugin);
|