weapp-tailwindcss 3.0.10 → 3.0.11
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/cache/index.d.ts +2 -1
- package/dist/cli.js +2 -2
- package/dist/cli.mjs +2 -2
- package/dist/core.js +2 -2
- package/dist/core.mjs +2 -2
- package/dist/css-macro/postcss.js +3 -3
- package/dist/css-macro/postcss.mjs +3 -3
- package/dist/gulp.js +5 -3
- package/dist/gulp.mjs +5 -3
- package/dist/{index-BBGsdK79.js → index-BgWX0vrB.js} +4 -4
- package/dist/{index-CKzzVDhq.js → index-CarwQa1I.js} +6 -2
- package/dist/index-CgOpm8dH.mjs +130 -0
- package/dist/{index-CLxBL7MC.mjs → index-CsZGfl55.mjs} +3 -2
- package/dist/{index-DfbtBzIV.mjs → index-DG4lzarS.mjs} +4 -4
- package/dist/{index-C7QwtXvo.mjs → index-DKNUquoz.mjs} +6 -2
- package/dist/{index-CKXO21Qe.js → index-DyK5Vd4R.js} +3 -2
- package/dist/index-FotLKQvj.js +136 -0
- package/dist/index.js +6 -6
- package/dist/index.mjs +6 -6
- package/dist/{options-D74YiXdv.mjs → options-D8LYG9j8.mjs} +25 -14
- package/dist/{options-Ce8c4jgF.js → options-Zf1-GLWG.js} +25 -14
- package/dist/postcss.js +1 -1
- package/dist/postcss.mjs +1 -1
- package/dist/types.d.ts +2 -1
- package/dist/{v5-KEbKT7UN.mjs → v5-B8nkZNYC.mjs} +4 -4
- package/dist/{v5-B5nztYEa.js → v5-eVqDacrp.js} +4 -4
- package/dist/vite.js +4 -4
- package/dist/vite.mjs +4 -4
- package/dist/webpack.js +4 -4
- package/dist/webpack.mjs +4 -4
- package/dist/webpack4.js +4 -4
- package/dist/webpack4.mjs +4 -4
- package/package.json +29 -29
- package/dist/index-DMO3Y3vp.mjs +0 -64
- package/dist/index-DXyNWU95.js +0 -70
package/dist/cache/index.d.ts
CHANGED
|
@@ -26,5 +26,6 @@ export interface ICreateCacheReturnType {
|
|
|
26
26
|
source: CacheValue;
|
|
27
27
|
}>) => void | Promise<void>;
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
export type ICreateCacheOptions = boolean;
|
|
30
|
+
declare function createCache(options?: ICreateCacheOptions): ICreateCacheReturnType;
|
|
30
31
|
export { createCache };
|
package/dist/cli.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var semver = require('semver');
|
|
4
|
-
var options = require('./options-
|
|
5
|
-
var index = require('./index-
|
|
4
|
+
var options = require('./options-Zf1-GLWG.js');
|
|
5
|
+
var index = require('./index-CarwQa1I.js');
|
|
6
6
|
require('magic-string');
|
|
7
7
|
require('./replace.js');
|
|
8
8
|
require('@weapp-core/escape');
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import semver from 'semver';
|
|
2
|
-
import { g as getOptions, a as createPatch } from './options-
|
|
3
|
-
import { W as WEAPP_TW_REQUIRED_NODE_VERSION } from './index-
|
|
2
|
+
import { g as getOptions, a as createPatch } from './options-D8LYG9j8.mjs';
|
|
3
|
+
import { W as WEAPP_TW_REQUIRED_NODE_VERSION } from './index-DKNUquoz.mjs';
|
|
4
4
|
import 'magic-string';
|
|
5
5
|
import './replace.mjs';
|
|
6
6
|
import '@weapp-core/escape';
|
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-Zf1-GLWG.js');
|
|
6
6
|
require('magic-string');
|
|
7
7
|
require('./replace.js');
|
|
8
8
|
require('@weapp-core/escape');
|
|
@@ -17,7 +17,7 @@ require('./defu-Cdz2PomB.js');
|
|
|
17
17
|
require('@babel/types');
|
|
18
18
|
require('htmlparser2');
|
|
19
19
|
require('postcss');
|
|
20
|
-
require('./index-
|
|
20
|
+
require('./index-CarwQa1I.js');
|
|
21
21
|
require('@csstools/postcss-is-pseudo-class');
|
|
22
22
|
require('postcss-rem-to-responsive-pixel');
|
|
23
23
|
require('postcss-selector-parser');
|
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-D8LYG9j8.mjs';
|
|
2
2
|
import 'magic-string';
|
|
3
3
|
import './replace.mjs';
|
|
4
4
|
import '@weapp-core/escape';
|
|
@@ -13,7 +13,7 @@ import './defu-n46TJT6t.mjs';
|
|
|
13
13
|
import '@babel/types';
|
|
14
14
|
import 'htmlparser2';
|
|
15
15
|
import 'postcss';
|
|
16
|
-
import './index-
|
|
16
|
+
import './index-DKNUquoz.mjs';
|
|
17
17
|
import '@csstools/postcss-is-pseudo-class';
|
|
18
18
|
import 'postcss-rem-to-responsive-pixel';
|
|
19
19
|
import 'postcss-selector-parser';
|
|
@@ -8,6 +8,7 @@ const creator = () => {
|
|
|
8
8
|
prepare() {
|
|
9
9
|
return {
|
|
10
10
|
AtRule(atRule, helper) {
|
|
11
|
+
var _a;
|
|
11
12
|
if (atRule.name === 'media') {
|
|
12
13
|
const values = [];
|
|
13
14
|
constants.matchCustomPropertyFromValue(atRule.params, (arr) => {
|
|
@@ -17,14 +18,14 @@ const creator = () => {
|
|
|
17
18
|
const isNegative = atRule.params.includes('not');
|
|
18
19
|
const text = values.join(' ');
|
|
19
20
|
const comment = isNegative ? constants.ifndef(text) : constants.ifdef(text);
|
|
20
|
-
atRule.
|
|
21
|
+
atRule.replaceWith([
|
|
21
22
|
helper.comment({
|
|
22
23
|
raws: {
|
|
23
24
|
before: '\n'
|
|
24
25
|
},
|
|
25
26
|
text: comment.start
|
|
26
27
|
}),
|
|
27
|
-
...atRule.nodes,
|
|
28
|
+
...((_a = atRule.nodes) !== null && _a !== void 0 ? _a : []),
|
|
28
29
|
helper.comment({
|
|
29
30
|
raws: {
|
|
30
31
|
before: '\n'
|
|
@@ -32,7 +33,6 @@ const creator = () => {
|
|
|
32
33
|
text: comment.end
|
|
33
34
|
})
|
|
34
35
|
]);
|
|
35
|
-
atRule.remove();
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
},
|
|
@@ -6,6 +6,7 @@ const creator = () => {
|
|
|
6
6
|
prepare() {
|
|
7
7
|
return {
|
|
8
8
|
AtRule(atRule, helper) {
|
|
9
|
+
var _a;
|
|
9
10
|
if (atRule.name === 'media') {
|
|
10
11
|
const values = [];
|
|
11
12
|
matchCustomPropertyFromValue(atRule.params, (arr) => {
|
|
@@ -15,14 +16,14 @@ const creator = () => {
|
|
|
15
16
|
const isNegative = atRule.params.includes('not');
|
|
16
17
|
const text = values.join(' ');
|
|
17
18
|
const comment = isNegative ? ifndef(text) : ifdef(text);
|
|
18
|
-
atRule.
|
|
19
|
+
atRule.replaceWith([
|
|
19
20
|
helper.comment({
|
|
20
21
|
raws: {
|
|
21
22
|
before: '\n'
|
|
22
23
|
},
|
|
23
24
|
text: comment.start
|
|
24
25
|
}),
|
|
25
|
-
...atRule.nodes,
|
|
26
|
+
...((_a = atRule.nodes) !== null && _a !== void 0 ? _a : []),
|
|
26
27
|
helper.comment({
|
|
27
28
|
raws: {
|
|
28
29
|
before: '\n'
|
|
@@ -30,7 +31,6 @@ const creator = () => {
|
|
|
30
31
|
text: comment.end
|
|
31
32
|
})
|
|
32
33
|
]);
|
|
33
|
-
atRule.remove();
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
},
|
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-FotLKQvj.js');
|
|
6
|
+
require('./options-Zf1-GLWG.js');
|
|
7
7
|
require('magic-string');
|
|
8
8
|
require('./replace.js');
|
|
9
9
|
require('@weapp-core/escape');
|
|
@@ -18,7 +18,7 @@ require('./defu-Cdz2PomB.js');
|
|
|
18
18
|
require('@babel/types');
|
|
19
19
|
require('htmlparser2');
|
|
20
20
|
require('postcss');
|
|
21
|
-
require('./index-
|
|
21
|
+
require('./index-CarwQa1I.js');
|
|
22
22
|
require('@csstools/postcss-is-pseudo-class');
|
|
23
23
|
require('postcss-rem-to-responsive-pixel');
|
|
24
24
|
require('postcss-selector-parser');
|
|
@@ -30,6 +30,8 @@ require('@tailwindcss-mangle/shared');
|
|
|
30
30
|
require('lru-cache');
|
|
31
31
|
require('md5');
|
|
32
32
|
require('node:stream');
|
|
33
|
+
require('./index-DyK5Vd4R.js');
|
|
34
|
+
require('debug');
|
|
33
35
|
|
|
34
36
|
|
|
35
37
|
|
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-CgOpm8dH.mjs';
|
|
2
|
+
import './options-D8LYG9j8.mjs';
|
|
3
3
|
import 'magic-string';
|
|
4
4
|
import './replace.mjs';
|
|
5
5
|
import '@weapp-core/escape';
|
|
@@ -14,7 +14,7 @@ import './defu-n46TJT6t.mjs';
|
|
|
14
14
|
import '@babel/types';
|
|
15
15
|
import 'htmlparser2';
|
|
16
16
|
import 'postcss';
|
|
17
|
-
import './index-
|
|
17
|
+
import './index-DKNUquoz.mjs';
|
|
18
18
|
import '@csstools/postcss-is-pseudo-class';
|
|
19
19
|
import 'postcss-rem-to-responsive-pixel';
|
|
20
20
|
import 'postcss-selector-parser';
|
|
@@ -26,3 +26,5 @@ import '@tailwindcss-mangle/shared';
|
|
|
26
26
|
import 'lru-cache';
|
|
27
27
|
import 'md5';
|
|
28
28
|
import 'node:stream';
|
|
29
|
+
import './index-CsZGfl55.mjs';
|
|
30
|
+
import 'debug';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var options = require('./options-
|
|
4
|
-
var index = require('./index-
|
|
3
|
+
var options = require('./options-Zf1-GLWG.js');
|
|
4
|
+
var index = require('./index-CarwQa1I.js');
|
|
5
5
|
var defaults = require('./defaults-BT3A8Rzc.js');
|
|
6
|
-
var index$1 = require('./index-
|
|
6
|
+
var index$1 = require('./index-DyK5Vd4R.js');
|
|
7
7
|
|
|
8
|
-
const debug = index$1.createDebug(
|
|
8
|
+
const debug = index$1.createDebug();
|
|
9
9
|
function UnifiedViteWeappTailwindcssPlugin(options$1 = {}) {
|
|
10
10
|
if (options$1.customReplaceDictionary === undefined) {
|
|
11
11
|
options$1.customReplaceDictionary = 'simple';
|
|
@@ -396,8 +396,12 @@ const postcssWeappTailwindcssPrePlugin = (options = {
|
|
|
396
396
|
},
|
|
397
397
|
AtRule(atRule) {
|
|
398
398
|
if (isAtMediaHover(atRule)) {
|
|
399
|
-
|
|
400
|
-
|
|
399
|
+
if (atRule.nodes) {
|
|
400
|
+
atRule.replaceWith(atRule.nodes);
|
|
401
|
+
}
|
|
402
|
+
else {
|
|
403
|
+
atRule.remove();
|
|
404
|
+
}
|
|
401
405
|
}
|
|
402
406
|
}
|
|
403
407
|
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-D8LYG9j8.mjs';
|
|
2
|
+
import stream from 'node:stream';
|
|
3
|
+
import { c as createDebug } from './index-CsZGfl55.mjs';
|
|
4
|
+
|
|
5
|
+
const debug = createDebug();
|
|
6
|
+
const Transform = stream.Transform;
|
|
7
|
+
function createPlugins(options = {}) {
|
|
8
|
+
const opts = getOptions(options);
|
|
9
|
+
const { templateHandler, styleHandler, patch, jsHandler, setMangleRuntimeSet, tailwindcssBasedir, cache } = opts;
|
|
10
|
+
let runtimeSet = new Set();
|
|
11
|
+
patch === null || patch === void 0 ? void 0 : patch();
|
|
12
|
+
const twPatcher = createTailwindcssPatcher();
|
|
13
|
+
function transformWxss() {
|
|
14
|
+
return new Transform({
|
|
15
|
+
objectMode: true,
|
|
16
|
+
transform: function (file, encoding, callback) {
|
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
runtimeSet = twPatcher.getClassSet({
|
|
19
|
+
basedir: tailwindcssBasedir
|
|
20
|
+
});
|
|
21
|
+
setMangleRuntimeSet(runtimeSet);
|
|
22
|
+
const error = null;
|
|
23
|
+
if (file.contents) {
|
|
24
|
+
const rawSource = file.contents.toString();
|
|
25
|
+
const hash = cache.computeHash(rawSource);
|
|
26
|
+
cache.calcHashValueChanged(file.path, hash);
|
|
27
|
+
yield cache.process(file.path, () => {
|
|
28
|
+
const source = cache.get(file.path);
|
|
29
|
+
if (source) {
|
|
30
|
+
file.contents = Buffer.from(source);
|
|
31
|
+
debug('css cache hit: %s', file.path);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}, () => __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
const code = yield styleHandler(rawSource, {
|
|
38
|
+
isMainChunk: true
|
|
39
|
+
});
|
|
40
|
+
file.contents = Buffer.from(code);
|
|
41
|
+
debug('css handle: %s', file.path);
|
|
42
|
+
return {
|
|
43
|
+
key: file.path,
|
|
44
|
+
source: code
|
|
45
|
+
};
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
callback(error, file);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function transformJs() {
|
|
54
|
+
return new Transform({
|
|
55
|
+
objectMode: true,
|
|
56
|
+
transform: function (file, encoding, callback) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const error = null;
|
|
59
|
+
if (file.contents) {
|
|
60
|
+
const rawSource = file.contents.toString();
|
|
61
|
+
const hash = cache.computeHash(rawSource);
|
|
62
|
+
cache.calcHashValueChanged(file.path, hash);
|
|
63
|
+
yield cache.process(file.path, () => {
|
|
64
|
+
const source = cache.get(file.path);
|
|
65
|
+
if (source) {
|
|
66
|
+
file.contents = Buffer.from(source);
|
|
67
|
+
debug('js cache hit: %s', file.path);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
}, () => {
|
|
73
|
+
const { code } = jsHandler(rawSource, runtimeSet);
|
|
74
|
+
file.contents = Buffer.from(code);
|
|
75
|
+
debug('js handle: %s', file.path);
|
|
76
|
+
return {
|
|
77
|
+
key: file.path,
|
|
78
|
+
source: code
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
callback(error, file);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function transformWxml() {
|
|
88
|
+
return new Transform({
|
|
89
|
+
objectMode: true,
|
|
90
|
+
transform: function (file, encoding, callback) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
const error = null;
|
|
93
|
+
if (file.contents) {
|
|
94
|
+
const rawSource = file.contents.toString();
|
|
95
|
+
const hash = cache.computeHash(rawSource);
|
|
96
|
+
cache.calcHashValueChanged(file.path, hash);
|
|
97
|
+
yield cache.process(file.path, () => {
|
|
98
|
+
const source = cache.get(file.path);
|
|
99
|
+
if (source) {
|
|
100
|
+
file.contents = Buffer.from(source);
|
|
101
|
+
debug('html cache hit: %s', file.path);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
}, () => {
|
|
107
|
+
const code = templateHandler(rawSource, {
|
|
108
|
+
runtimeSet
|
|
109
|
+
});
|
|
110
|
+
file.contents = Buffer.from(code);
|
|
111
|
+
debug('html handle: %s', file.path);
|
|
112
|
+
return {
|
|
113
|
+
key: file.path,
|
|
114
|
+
source: code
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
callback(error, file);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
transformWxss,
|
|
125
|
+
transformWxml,
|
|
126
|
+
transformJs
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export { createPlugins as c };
|
|
@@ -2,9 +2,10 @@ import _createDebug from 'debug';
|
|
|
2
2
|
|
|
3
3
|
const _debug = _createDebug('weapp-tw');
|
|
4
4
|
function createDebug(prefix) {
|
|
5
|
-
|
|
5
|
+
function debug(formatter, ...args) {
|
|
6
6
|
return _debug((prefix !== null && prefix !== void 0 ? prefix : '') + formatter, ...args);
|
|
7
|
-
}
|
|
7
|
+
}
|
|
8
|
+
return debug;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export { createDebug as c };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-
|
|
2
|
-
import { v as vitePluginName } from './index-
|
|
1
|
+
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-D8LYG9j8.mjs';
|
|
2
|
+
import { v as vitePluginName } from './index-DKNUquoz.mjs';
|
|
3
3
|
import { g as getGroupedEntries } from './defaults-CBb6_9nJ.mjs';
|
|
4
|
-
import { c as createDebug } from './index-
|
|
4
|
+
import { c as createDebug } from './index-CsZGfl55.mjs';
|
|
5
5
|
|
|
6
|
-
const debug = createDebug(
|
|
6
|
+
const debug = createDebug();
|
|
7
7
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
8
8
|
if (options.customReplaceDictionary === undefined) {
|
|
9
9
|
options.customReplaceDictionary = 'simple';
|
|
@@ -388,8 +388,12 @@ const postcssWeappTailwindcssPrePlugin = (options = {
|
|
|
388
388
|
},
|
|
389
389
|
AtRule(atRule) {
|
|
390
390
|
if (isAtMediaHover(atRule)) {
|
|
391
|
-
|
|
392
|
-
|
|
391
|
+
if (atRule.nodes) {
|
|
392
|
+
atRule.replaceWith(atRule.nodes);
|
|
393
|
+
}
|
|
394
|
+
else {
|
|
395
|
+
atRule.remove();
|
|
396
|
+
}
|
|
393
397
|
}
|
|
394
398
|
}
|
|
395
399
|
};
|
|
@@ -8,9 +8,10 @@ var _createDebug__default = /*#__PURE__*/_interopDefaultCompat(_createDebug);
|
|
|
8
8
|
|
|
9
9
|
const _debug = _createDebug__default["default"]('weapp-tw');
|
|
10
10
|
function createDebug(prefix) {
|
|
11
|
-
|
|
11
|
+
function debug(formatter, ...args) {
|
|
12
12
|
return _debug((prefix !== null && prefix !== void 0 ? prefix : '') + formatter, ...args);
|
|
13
|
-
}
|
|
13
|
+
}
|
|
14
|
+
return debug;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
exports.createDebug = createDebug;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var options = require('./options-Zf1-GLWG.js');
|
|
4
|
+
var stream = require('node:stream');
|
|
5
|
+
var index = require('./index-DyK5Vd4R.js');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var stream__default = /*#__PURE__*/_interopDefaultCompat(stream);
|
|
10
|
+
|
|
11
|
+
const debug = index.createDebug();
|
|
12
|
+
const Transform = stream__default["default"].Transform;
|
|
13
|
+
function createPlugins(options$1 = {}) {
|
|
14
|
+
const opts = options.getOptions(options$1);
|
|
15
|
+
const { templateHandler, styleHandler, patch, jsHandler, setMangleRuntimeSet, tailwindcssBasedir, cache } = opts;
|
|
16
|
+
let runtimeSet = new Set();
|
|
17
|
+
patch === null || patch === void 0 ? void 0 : patch();
|
|
18
|
+
const twPatcher = options.createTailwindcssPatcher();
|
|
19
|
+
function transformWxss() {
|
|
20
|
+
return new Transform({
|
|
21
|
+
objectMode: true,
|
|
22
|
+
transform: function (file, encoding, callback) {
|
|
23
|
+
return options.__awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
runtimeSet = twPatcher.getClassSet({
|
|
25
|
+
basedir: tailwindcssBasedir
|
|
26
|
+
});
|
|
27
|
+
setMangleRuntimeSet(runtimeSet);
|
|
28
|
+
const error = null;
|
|
29
|
+
if (file.contents) {
|
|
30
|
+
const rawSource = file.contents.toString();
|
|
31
|
+
const hash = cache.computeHash(rawSource);
|
|
32
|
+
cache.calcHashValueChanged(file.path, hash);
|
|
33
|
+
yield cache.process(file.path, () => {
|
|
34
|
+
const source = cache.get(file.path);
|
|
35
|
+
if (source) {
|
|
36
|
+
file.contents = Buffer.from(source);
|
|
37
|
+
debug('css cache hit: %s', file.path);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}, () => options.__awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
const code = yield styleHandler(rawSource, {
|
|
44
|
+
isMainChunk: true
|
|
45
|
+
});
|
|
46
|
+
file.contents = Buffer.from(code);
|
|
47
|
+
debug('css handle: %s', file.path);
|
|
48
|
+
return {
|
|
49
|
+
key: file.path,
|
|
50
|
+
source: code
|
|
51
|
+
};
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
callback(error, file);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function transformJs() {
|
|
60
|
+
return new Transform({
|
|
61
|
+
objectMode: true,
|
|
62
|
+
transform: function (file, encoding, callback) {
|
|
63
|
+
return options.__awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
const error = null;
|
|
65
|
+
if (file.contents) {
|
|
66
|
+
const rawSource = file.contents.toString();
|
|
67
|
+
const hash = cache.computeHash(rawSource);
|
|
68
|
+
cache.calcHashValueChanged(file.path, hash);
|
|
69
|
+
yield cache.process(file.path, () => {
|
|
70
|
+
const source = cache.get(file.path);
|
|
71
|
+
if (source) {
|
|
72
|
+
file.contents = Buffer.from(source);
|
|
73
|
+
debug('js cache hit: %s', file.path);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
}, () => {
|
|
79
|
+
const { code } = jsHandler(rawSource, runtimeSet);
|
|
80
|
+
file.contents = Buffer.from(code);
|
|
81
|
+
debug('js handle: %s', file.path);
|
|
82
|
+
return {
|
|
83
|
+
key: file.path,
|
|
84
|
+
source: code
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
callback(error, file);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function transformWxml() {
|
|
94
|
+
return new Transform({
|
|
95
|
+
objectMode: true,
|
|
96
|
+
transform: function (file, encoding, callback) {
|
|
97
|
+
return options.__awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
const error = null;
|
|
99
|
+
if (file.contents) {
|
|
100
|
+
const rawSource = file.contents.toString();
|
|
101
|
+
const hash = cache.computeHash(rawSource);
|
|
102
|
+
cache.calcHashValueChanged(file.path, hash);
|
|
103
|
+
yield cache.process(file.path, () => {
|
|
104
|
+
const source = cache.get(file.path);
|
|
105
|
+
if (source) {
|
|
106
|
+
file.contents = Buffer.from(source);
|
|
107
|
+
debug('html cache hit: %s', file.path);
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
}, () => {
|
|
113
|
+
const code = templateHandler(rawSource, {
|
|
114
|
+
runtimeSet
|
|
115
|
+
});
|
|
116
|
+
file.contents = Buffer.from(code);
|
|
117
|
+
debug('html handle: %s', file.path);
|
|
118
|
+
return {
|
|
119
|
+
key: file.path,
|
|
120
|
+
source: code
|
|
121
|
+
};
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
callback(error, file);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
transformWxss,
|
|
131
|
+
transformWxml,
|
|
132
|
+
transformJs
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
exports.createPlugins = createPlugins;
|
package/dist/index.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var v5 = require('./v5-
|
|
6
|
-
var index = require('./index-
|
|
7
|
-
var index$1 = require('./index-
|
|
8
|
-
require('./options-
|
|
5
|
+
var v5 = require('./v5-eVqDacrp.js');
|
|
6
|
+
var index = require('./index-BgWX0vrB.js');
|
|
7
|
+
var index$1 = require('./index-FotLKQvj.js');
|
|
8
|
+
require('./options-Zf1-GLWG.js');
|
|
9
9
|
require('magic-string');
|
|
10
10
|
require('./replace.js');
|
|
11
11
|
require('@weapp-core/escape');
|
|
@@ -20,7 +20,7 @@ require('./defu-Cdz2PomB.js');
|
|
|
20
20
|
require('@babel/types');
|
|
21
21
|
require('htmlparser2');
|
|
22
22
|
require('postcss');
|
|
23
|
-
require('./index-
|
|
23
|
+
require('./index-CarwQa1I.js');
|
|
24
24
|
require('@csstools/postcss-is-pseudo-class');
|
|
25
25
|
require('postcss-rem-to-responsive-pixel');
|
|
26
26
|
require('postcss-selector-parser');
|
|
@@ -31,7 +31,7 @@ require('tailwindcss-patch');
|
|
|
31
31
|
require('@tailwindcss-mangle/shared');
|
|
32
32
|
require('lru-cache');
|
|
33
33
|
require('md5');
|
|
34
|
-
require('./index-
|
|
34
|
+
require('./index-DyK5Vd4R.js');
|
|
35
35
|
require('debug');
|
|
36
36
|
require('node:stream');
|
|
37
37
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { U as UnifiedWebpackPluginV5 } from './v5-
|
|
2
|
-
export { U as UnifiedViteWeappTailwindcssPlugin } from './index-
|
|
3
|
-
export { c as createPlugins } from './index-
|
|
4
|
-
import './options-
|
|
1
|
+
export { U as UnifiedWebpackPluginV5 } from './v5-B8nkZNYC.mjs';
|
|
2
|
+
export { U as UnifiedViteWeappTailwindcssPlugin } from './index-DG4lzarS.mjs';
|
|
3
|
+
export { c as createPlugins } from './index-CgOpm8dH.mjs';
|
|
4
|
+
import './options-D8LYG9j8.mjs';
|
|
5
5
|
import 'magic-string';
|
|
6
6
|
import './replace.mjs';
|
|
7
7
|
import '@weapp-core/escape';
|
|
@@ -16,7 +16,7 @@ import './defu-n46TJT6t.mjs';
|
|
|
16
16
|
import '@babel/types';
|
|
17
17
|
import 'htmlparser2';
|
|
18
18
|
import 'postcss';
|
|
19
|
-
import './index-
|
|
19
|
+
import './index-DKNUquoz.mjs';
|
|
20
20
|
import '@csstools/postcss-is-pseudo-class';
|
|
21
21
|
import 'postcss-rem-to-responsive-pixel';
|
|
22
22
|
import 'postcss-selector-parser';
|
|
@@ -27,6 +27,6 @@ import 'tailwindcss-patch';
|
|
|
27
27
|
import '@tailwindcss-mangle/shared';
|
|
28
28
|
import 'lru-cache';
|
|
29
29
|
import 'md5';
|
|
30
|
-
import './index-
|
|
30
|
+
import './index-CsZGfl55.mjs';
|
|
31
31
|
import 'debug';
|
|
32
32
|
import 'node:stream';
|