weapp-tailwindcss 2.11.1 → 2.11.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/CHANGELOG.md +594 -0
- package/README_en.md +139 -0
- package/dist/cli.js +5 -5
- package/dist/cli.mjs +5 -5
- package/dist/core.js +5 -5
- package/dist/core.mjs +5 -5
- package/dist/css-macro/index.js +3 -3
- package/dist/css-macro/index.mjs +2 -2
- package/dist/css-macro/postcss.js +1 -1
- package/dist/css-macro/postcss.mjs +1 -1
- package/dist/defaults.js +1 -1
- package/dist/defaults.mjs +1 -1
- package/dist/{defu-NLkZUlr9.mjs → defu-D2_bzAv0.mjs} +19 -9
- package/dist/{defu-VMJMz2AB.js → defu-JkbfvVKI.js} +19 -9
- package/dist/gulp.js +8 -69
- package/dist/gulp.mjs +7 -68
- package/dist/index-C70Rgk3g.js +142 -0
- package/dist/{index-z25r_Htj.js → index-CKXO21Qe.js} +1 -1
- package/dist/index-D3TDwy2Y.mjs +140 -0
- package/dist/index-De0cmOEK.js +70 -0
- package/dist/index-QLyv-Fcp.mjs +64 -0
- package/dist/index.js +12 -12
- package/dist/index.mjs +9 -9
- package/dist/{options-M8pGfjj_.mjs → options-B5UOFsZN.mjs} +42 -49
- package/dist/{options-lXV72tWf.js → options-BAFFNEBI.js} +43 -50
- package/dist/{postcss-Et8j4ugT.js → plugin-Bxt3oO75.js} +2 -2
- package/dist/{postcss-W8i3cl5I.mjs → plugin-Du3zrk3S.mjs} +1 -1
- package/dist/postcss.js +5 -5
- package/dist/postcss.mjs +2 -2
- package/dist/replace.js +6 -6
- package/dist/replace.mjs +1 -1
- package/dist/types.d.ts +2 -1
- package/dist/v5-Crbh5I-S.js +187 -0
- package/dist/v5-V8LlDF1a.mjs +180 -0
- package/dist/vite.js +10 -141
- package/dist/vite.mjs +8 -143
- package/dist/weapp-tw-runtime-loader.js +1 -1
- package/dist/webpack.js +11 -185
- package/dist/webpack.mjs +10 -183
- package/package.json +97 -95
- /package/dist/{constants-ol1NPf7z.mjs → constants-CcqTvLgQ.mjs} +0 -0
- /package/dist/{constants-EVxkHOXL.js → constants-D-YMDg7M.js} +0 -0
- /package/dist/{defaults-dz6xGhOP.mjs → defaults-DMBtD8TO.mjs} +0 -0
- /package/dist/{defaults-0O-zKoXE.js → defaults-qX2VLo8u.js} +0 -0
- /package/dist/{index-06BoOZig.mjs → index-CLxBL7MC.mjs} +0 -0
- /package/dist/{shared-S0v7ZvWs.mjs → shared-D4ZM_mI-.mjs} +0 -0
- /package/dist/{shared-nXoJWFdz.js → shared-DtRIj-D_.js} +0 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var options = require('./options-BAFFNEBI.js');
|
|
4
|
+
var plugin = require('./plugin-Bxt3oO75.js');
|
|
5
|
+
var defaults = require('./defaults-qX2VLo8u.js');
|
|
6
|
+
var index = require('./index-CKXO21Qe.js');
|
|
7
|
+
|
|
8
|
+
const debug = index.createDebug('generateBundle: ');
|
|
9
|
+
function UnifiedViteWeappTailwindcssPlugin(options$1 = {}) {
|
|
10
|
+
if (options$1.customReplaceDictionary === undefined) {
|
|
11
|
+
options$1.customReplaceDictionary = 'simple';
|
|
12
|
+
}
|
|
13
|
+
const opts = options.getOptions(options$1);
|
|
14
|
+
const { disabled, onEnd, onLoad, onStart, onUpdate, templateHandler, styleHandler, patch, jsHandler, mainCssChunkMatcher, appType, setMangleRuntimeSet, cache, tailwindcssBasedir } = opts;
|
|
15
|
+
if (disabled) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
patch === null || patch === void 0 ? void 0 : patch();
|
|
19
|
+
const twPatcher = options.createTailwindcssPatcher();
|
|
20
|
+
onLoad();
|
|
21
|
+
return {
|
|
22
|
+
name: plugin.vitePluginName,
|
|
23
|
+
enforce: 'post',
|
|
24
|
+
generateBundle(opt, bundle) {
|
|
25
|
+
return options.__awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
debug('start');
|
|
27
|
+
onStart();
|
|
28
|
+
const entries = Object.entries(bundle);
|
|
29
|
+
const groupedEntries = defaults.getGroupedEntries(entries, opts);
|
|
30
|
+
const runtimeSet = twPatcher.getClassSet({
|
|
31
|
+
basedir: tailwindcssBasedir
|
|
32
|
+
});
|
|
33
|
+
setMangleRuntimeSet(runtimeSet);
|
|
34
|
+
debug('get runtimeSet, class count: %d', runtimeSet.size);
|
|
35
|
+
if (Array.isArray(groupedEntries.html)) {
|
|
36
|
+
let noCachedCount = 0;
|
|
37
|
+
for (let i = 0; i < groupedEntries.html.length; i++) {
|
|
38
|
+
const [file, originalSource] = groupedEntries.html[i];
|
|
39
|
+
const oldVal = originalSource.source.toString();
|
|
40
|
+
const hash = cache.computeHash(oldVal);
|
|
41
|
+
cache.calcHashValueChanged(file, hash);
|
|
42
|
+
yield cache.process(file, () => {
|
|
43
|
+
const source = cache.get(file);
|
|
44
|
+
if (source) {
|
|
45
|
+
originalSource.source = source;
|
|
46
|
+
debug('html cache hit: %s', file);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
}, () => {
|
|
52
|
+
originalSource.source = templateHandler(oldVal, {
|
|
53
|
+
runtimeSet
|
|
54
|
+
});
|
|
55
|
+
onUpdate(file, oldVal, originalSource.source);
|
|
56
|
+
debug('html handle: %s', file);
|
|
57
|
+
noCachedCount++;
|
|
58
|
+
return {
|
|
59
|
+
key: file,
|
|
60
|
+
source: originalSource.source
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
debug('html handle finish, total: %d, no-cached: %d', groupedEntries.html.length, noCachedCount);
|
|
65
|
+
}
|
|
66
|
+
if (Array.isArray(groupedEntries.js)) {
|
|
67
|
+
let noCachedCount = 0;
|
|
68
|
+
for (let i = 0; i < groupedEntries.js.length; i++) {
|
|
69
|
+
const [file, originalSource] = groupedEntries.js[i];
|
|
70
|
+
const rawSource = originalSource.code;
|
|
71
|
+
const hash = cache.computeHash(rawSource);
|
|
72
|
+
cache.calcHashValueChanged(file, hash);
|
|
73
|
+
yield cache.process(file, () => {
|
|
74
|
+
const source = cache.get(file);
|
|
75
|
+
if (source) {
|
|
76
|
+
originalSource.code = source;
|
|
77
|
+
debug('js cache hit: %s', file);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
}, () => {
|
|
83
|
+
const mapFilename = file + '.map';
|
|
84
|
+
const hasMap = Boolean(bundle[mapFilename]);
|
|
85
|
+
const { code, map } = jsHandler(rawSource, runtimeSet, {
|
|
86
|
+
generateMap: hasMap
|
|
87
|
+
});
|
|
88
|
+
originalSource.code = code;
|
|
89
|
+
onUpdate(file, rawSource, code);
|
|
90
|
+
debug('js handle: %s', file);
|
|
91
|
+
noCachedCount++;
|
|
92
|
+
if (hasMap && map) {
|
|
93
|
+
bundle[mapFilename].source = map.toString();
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
key: file,
|
|
97
|
+
source: code
|
|
98
|
+
};
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
debug('js handle finish, total: %d, no-cached: %d', groupedEntries.js.length, noCachedCount);
|
|
102
|
+
}
|
|
103
|
+
if (Array.isArray(groupedEntries.css)) {
|
|
104
|
+
let noCachedCount = 0;
|
|
105
|
+
for (let i = 0; i < groupedEntries.css.length; i++) {
|
|
106
|
+
const [file, originalSource] = groupedEntries.css[i];
|
|
107
|
+
const rawSource = originalSource.source.toString();
|
|
108
|
+
const hash = cache.computeHash(rawSource);
|
|
109
|
+
cache.calcHashValueChanged(file, hash);
|
|
110
|
+
yield cache.process(file, () => {
|
|
111
|
+
const source = cache.get(file);
|
|
112
|
+
if (source) {
|
|
113
|
+
originalSource.source = source;
|
|
114
|
+
debug('css cache hit: %s', file);
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
}, () => options.__awaiter(this, void 0, void 0, function* () {
|
|
120
|
+
const css = yield styleHandler(rawSource, {
|
|
121
|
+
isMainChunk: mainCssChunkMatcher(originalSource.fileName, appType)
|
|
122
|
+
});
|
|
123
|
+
originalSource.source = css;
|
|
124
|
+
onUpdate(file, rawSource, css);
|
|
125
|
+
debug('css handle: %s', file);
|
|
126
|
+
noCachedCount++;
|
|
127
|
+
return {
|
|
128
|
+
key: file,
|
|
129
|
+
source: css
|
|
130
|
+
};
|
|
131
|
+
}));
|
|
132
|
+
}
|
|
133
|
+
debug('css handle finish, total: %d, no-cached: %d', groupedEntries.css.length, noCachedCount);
|
|
134
|
+
}
|
|
135
|
+
onEnd();
|
|
136
|
+
debug('end');
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
exports.UnifiedViteWeappTailwindcssPlugin = UnifiedViteWeappTailwindcssPlugin;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _createDebug = require('debug');
|
|
4
4
|
|
|
5
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : {
|
|
5
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
6
6
|
|
|
7
7
|
var _createDebug__default = /*#__PURE__*/_interopDefaultCompat(_createDebug);
|
|
8
8
|
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-B5UOFsZN.mjs';
|
|
2
|
+
import { v as vitePluginName } from './plugin-Du3zrk3S.mjs';
|
|
3
|
+
import { g as getGroupedEntries } from './defaults-DMBtD8TO.mjs';
|
|
4
|
+
import { c as createDebug } from './index-CLxBL7MC.mjs';
|
|
5
|
+
|
|
6
|
+
const debug = createDebug('generateBundle: ');
|
|
7
|
+
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
8
|
+
if (options.customReplaceDictionary === undefined) {
|
|
9
|
+
options.customReplaceDictionary = 'simple';
|
|
10
|
+
}
|
|
11
|
+
const opts = getOptions(options);
|
|
12
|
+
const { disabled, onEnd, onLoad, onStart, onUpdate, templateHandler, styleHandler, patch, jsHandler, mainCssChunkMatcher, appType, setMangleRuntimeSet, cache, tailwindcssBasedir } = opts;
|
|
13
|
+
if (disabled) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
patch === null || patch === void 0 ? void 0 : patch();
|
|
17
|
+
const twPatcher = createTailwindcssPatcher();
|
|
18
|
+
onLoad();
|
|
19
|
+
return {
|
|
20
|
+
name: vitePluginName,
|
|
21
|
+
enforce: 'post',
|
|
22
|
+
generateBundle(opt, bundle) {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
debug('start');
|
|
25
|
+
onStart();
|
|
26
|
+
const entries = Object.entries(bundle);
|
|
27
|
+
const groupedEntries = getGroupedEntries(entries, opts);
|
|
28
|
+
const runtimeSet = twPatcher.getClassSet({
|
|
29
|
+
basedir: tailwindcssBasedir
|
|
30
|
+
});
|
|
31
|
+
setMangleRuntimeSet(runtimeSet);
|
|
32
|
+
debug('get runtimeSet, class count: %d', runtimeSet.size);
|
|
33
|
+
if (Array.isArray(groupedEntries.html)) {
|
|
34
|
+
let noCachedCount = 0;
|
|
35
|
+
for (let i = 0; i < groupedEntries.html.length; i++) {
|
|
36
|
+
const [file, originalSource] = groupedEntries.html[i];
|
|
37
|
+
const oldVal = originalSource.source.toString();
|
|
38
|
+
const hash = cache.computeHash(oldVal);
|
|
39
|
+
cache.calcHashValueChanged(file, hash);
|
|
40
|
+
yield cache.process(file, () => {
|
|
41
|
+
const source = cache.get(file);
|
|
42
|
+
if (source) {
|
|
43
|
+
originalSource.source = source;
|
|
44
|
+
debug('html cache hit: %s', file);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
}, () => {
|
|
50
|
+
originalSource.source = templateHandler(oldVal, {
|
|
51
|
+
runtimeSet
|
|
52
|
+
});
|
|
53
|
+
onUpdate(file, oldVal, originalSource.source);
|
|
54
|
+
debug('html handle: %s', file);
|
|
55
|
+
noCachedCount++;
|
|
56
|
+
return {
|
|
57
|
+
key: file,
|
|
58
|
+
source: originalSource.source
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
debug('html handle finish, total: %d, no-cached: %d', groupedEntries.html.length, noCachedCount);
|
|
63
|
+
}
|
|
64
|
+
if (Array.isArray(groupedEntries.js)) {
|
|
65
|
+
let noCachedCount = 0;
|
|
66
|
+
for (let i = 0; i < groupedEntries.js.length; i++) {
|
|
67
|
+
const [file, originalSource] = groupedEntries.js[i];
|
|
68
|
+
const rawSource = originalSource.code;
|
|
69
|
+
const hash = cache.computeHash(rawSource);
|
|
70
|
+
cache.calcHashValueChanged(file, hash);
|
|
71
|
+
yield cache.process(file, () => {
|
|
72
|
+
const source = cache.get(file);
|
|
73
|
+
if (source) {
|
|
74
|
+
originalSource.code = source;
|
|
75
|
+
debug('js cache hit: %s', file);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
}, () => {
|
|
81
|
+
const mapFilename = file + '.map';
|
|
82
|
+
const hasMap = Boolean(bundle[mapFilename]);
|
|
83
|
+
const { code, map } = jsHandler(rawSource, runtimeSet, {
|
|
84
|
+
generateMap: hasMap
|
|
85
|
+
});
|
|
86
|
+
originalSource.code = code;
|
|
87
|
+
onUpdate(file, rawSource, code);
|
|
88
|
+
debug('js handle: %s', file);
|
|
89
|
+
noCachedCount++;
|
|
90
|
+
if (hasMap && map) {
|
|
91
|
+
bundle[mapFilename].source = map.toString();
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
key: file,
|
|
95
|
+
source: code
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
debug('js handle finish, total: %d, no-cached: %d', groupedEntries.js.length, noCachedCount);
|
|
100
|
+
}
|
|
101
|
+
if (Array.isArray(groupedEntries.css)) {
|
|
102
|
+
let noCachedCount = 0;
|
|
103
|
+
for (let i = 0; i < groupedEntries.css.length; i++) {
|
|
104
|
+
const [file, originalSource] = groupedEntries.css[i];
|
|
105
|
+
const rawSource = originalSource.source.toString();
|
|
106
|
+
const hash = cache.computeHash(rawSource);
|
|
107
|
+
cache.calcHashValueChanged(file, hash);
|
|
108
|
+
yield cache.process(file, () => {
|
|
109
|
+
const source = cache.get(file);
|
|
110
|
+
if (source) {
|
|
111
|
+
originalSource.source = source;
|
|
112
|
+
debug('css cache hit: %s', file);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
}, () => __awaiter(this, void 0, void 0, function* () {
|
|
118
|
+
const css = yield styleHandler(rawSource, {
|
|
119
|
+
isMainChunk: mainCssChunkMatcher(originalSource.fileName, appType)
|
|
120
|
+
});
|
|
121
|
+
originalSource.source = css;
|
|
122
|
+
onUpdate(file, rawSource, css);
|
|
123
|
+
debug('css handle: %s', file);
|
|
124
|
+
noCachedCount++;
|
|
125
|
+
return {
|
|
126
|
+
key: file,
|
|
127
|
+
source: css
|
|
128
|
+
};
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
debug('css handle finish, total: %d, no-cached: %d', groupedEntries.css.length, noCachedCount);
|
|
132
|
+
}
|
|
133
|
+
onEnd();
|
|
134
|
+
debug('end');
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export { UnifiedViteWeappTailwindcssPlugin as U };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var options = require('./options-BAFFNEBI.js');
|
|
4
|
+
var stream = require('node:stream');
|
|
5
|
+
|
|
6
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
7
|
+
|
|
8
|
+
var stream__default = /*#__PURE__*/_interopDefaultCompat(stream);
|
|
9
|
+
|
|
10
|
+
const Transform = stream__default["default"].Transform;
|
|
11
|
+
function createPlugins(options$1 = {}) {
|
|
12
|
+
const opts = options.getOptions(options$1);
|
|
13
|
+
const { templateHandler, styleHandler, patch, jsHandler, setMangleRuntimeSet, tailwindcssBasedir } = opts;
|
|
14
|
+
let runtimeSet = new Set();
|
|
15
|
+
patch === null || patch === void 0 ? void 0 : patch();
|
|
16
|
+
const twPatcher = options.createTailwindcssPatcher();
|
|
17
|
+
function transformWxss() {
|
|
18
|
+
const transformStream = new Transform({ objectMode: true });
|
|
19
|
+
transformStream._transform = function (file, encoding, callback) {
|
|
20
|
+
return options.__awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
runtimeSet = twPatcher.getClassSet({
|
|
22
|
+
basedir: tailwindcssBasedir
|
|
23
|
+
});
|
|
24
|
+
setMangleRuntimeSet(runtimeSet);
|
|
25
|
+
const error = null;
|
|
26
|
+
if (file.contents) {
|
|
27
|
+
const code = yield styleHandler(file.contents.toString(), {
|
|
28
|
+
isMainChunk: true
|
|
29
|
+
});
|
|
30
|
+
file.contents = Buffer.from(code);
|
|
31
|
+
}
|
|
32
|
+
callback(error, file);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
return transformStream;
|
|
36
|
+
}
|
|
37
|
+
function transformJs() {
|
|
38
|
+
const transformStream = new Transform({ objectMode: true });
|
|
39
|
+
transformStream._transform = function (file, encoding, callback) {
|
|
40
|
+
const error = null;
|
|
41
|
+
if (file.contents) {
|
|
42
|
+
const { code } = jsHandler(file.contents.toString(), runtimeSet);
|
|
43
|
+
file.contents = Buffer.from(code);
|
|
44
|
+
}
|
|
45
|
+
callback(error, file);
|
|
46
|
+
};
|
|
47
|
+
return transformStream;
|
|
48
|
+
}
|
|
49
|
+
function transformWxml() {
|
|
50
|
+
const transformStream = new Transform({ objectMode: true });
|
|
51
|
+
transformStream._transform = function (file, encoding, callback) {
|
|
52
|
+
const error = null;
|
|
53
|
+
if (file.contents) {
|
|
54
|
+
const code = templateHandler(file.contents.toString(), {
|
|
55
|
+
runtimeSet
|
|
56
|
+
});
|
|
57
|
+
file.contents = Buffer.from(code);
|
|
58
|
+
}
|
|
59
|
+
callback(error, file);
|
|
60
|
+
};
|
|
61
|
+
return transformStream;
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
transformWxss,
|
|
65
|
+
transformWxml,
|
|
66
|
+
transformJs
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
exports.createPlugins = createPlugins;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-B5UOFsZN.mjs';
|
|
2
|
+
import stream from 'node:stream';
|
|
3
|
+
|
|
4
|
+
const Transform = stream.Transform;
|
|
5
|
+
function createPlugins(options = {}) {
|
|
6
|
+
const opts = getOptions(options);
|
|
7
|
+
const { templateHandler, styleHandler, patch, jsHandler, setMangleRuntimeSet, tailwindcssBasedir } = opts;
|
|
8
|
+
let runtimeSet = new Set();
|
|
9
|
+
patch === null || patch === void 0 ? void 0 : patch();
|
|
10
|
+
const twPatcher = createTailwindcssPatcher();
|
|
11
|
+
function transformWxss() {
|
|
12
|
+
const transformStream = new Transform({ objectMode: true });
|
|
13
|
+
transformStream._transform = function (file, encoding, callback) {
|
|
14
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
runtimeSet = twPatcher.getClassSet({
|
|
16
|
+
basedir: tailwindcssBasedir
|
|
17
|
+
});
|
|
18
|
+
setMangleRuntimeSet(runtimeSet);
|
|
19
|
+
const error = null;
|
|
20
|
+
if (file.contents) {
|
|
21
|
+
const code = yield styleHandler(file.contents.toString(), {
|
|
22
|
+
isMainChunk: true
|
|
23
|
+
});
|
|
24
|
+
file.contents = Buffer.from(code);
|
|
25
|
+
}
|
|
26
|
+
callback(error, file);
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
return transformStream;
|
|
30
|
+
}
|
|
31
|
+
function transformJs() {
|
|
32
|
+
const transformStream = new Transform({ objectMode: true });
|
|
33
|
+
transformStream._transform = function (file, encoding, callback) {
|
|
34
|
+
const error = null;
|
|
35
|
+
if (file.contents) {
|
|
36
|
+
const { code } = jsHandler(file.contents.toString(), runtimeSet);
|
|
37
|
+
file.contents = Buffer.from(code);
|
|
38
|
+
}
|
|
39
|
+
callback(error, file);
|
|
40
|
+
};
|
|
41
|
+
return transformStream;
|
|
42
|
+
}
|
|
43
|
+
function transformWxml() {
|
|
44
|
+
const transformStream = new Transform({ objectMode: true });
|
|
45
|
+
transformStream._transform = function (file, encoding, callback) {
|
|
46
|
+
const error = null;
|
|
47
|
+
if (file.contents) {
|
|
48
|
+
const code = templateHandler(file.contents.toString(), {
|
|
49
|
+
runtimeSet
|
|
50
|
+
});
|
|
51
|
+
file.contents = Buffer.from(code);
|
|
52
|
+
}
|
|
53
|
+
callback(error, file);
|
|
54
|
+
};
|
|
55
|
+
return transformStream;
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
transformWxss,
|
|
59
|
+
transformWxml,
|
|
60
|
+
transformJs
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export { createPlugins as c };
|
package/dist/index.js
CHANGED
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
require('./options-
|
|
5
|
+
var v5 = require('./v5-Crbh5I-S.js');
|
|
6
|
+
var index = require('./index-C70Rgk3g.js');
|
|
7
|
+
var index$1 = require('./index-De0cmOEK.js');
|
|
8
|
+
require('./options-BAFFNEBI.js');
|
|
9
9
|
require('micromatch');
|
|
10
10
|
require('magic-string');
|
|
11
11
|
require('./replace.js');
|
|
12
12
|
require('@weapp-core/escape');
|
|
13
13
|
require('@ast-core/escape');
|
|
14
|
-
require('./shared-
|
|
14
|
+
require('./shared-DtRIj-D_.js');
|
|
15
15
|
require('@weapp-core/regex');
|
|
16
16
|
require('@babel/generator');
|
|
17
17
|
require('@babel/parser');
|
|
18
18
|
require('@babel/traverse');
|
|
19
|
-
require('./defu-
|
|
20
|
-
require('./defaults-
|
|
19
|
+
require('./defu-JkbfvVKI.js');
|
|
20
|
+
require('./defaults-qX2VLo8u.js');
|
|
21
21
|
require('@babel/types');
|
|
22
22
|
require('htmlparser2');
|
|
23
23
|
require('postcss');
|
|
24
|
-
require('./
|
|
24
|
+
require('./plugin-Bxt3oO75.js');
|
|
25
25
|
require('postcss-selector-parser');
|
|
26
26
|
require('@csstools/postcss-is-pseudo-class');
|
|
27
27
|
require('node:path');
|
|
@@ -31,12 +31,12 @@ require('tailwindcss-patch');
|
|
|
31
31
|
require('@tailwindcss-mangle/shared');
|
|
32
32
|
require('lru-cache');
|
|
33
33
|
require('md5');
|
|
34
|
-
require('./index-
|
|
34
|
+
require('./index-CKXO21Qe.js');
|
|
35
35
|
require('debug');
|
|
36
36
|
require('node:stream');
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
exports.UnifiedWebpackPluginV5 =
|
|
41
|
-
exports.UnifiedViteWeappTailwindcssPlugin =
|
|
42
|
-
exports.createPlugins =
|
|
40
|
+
exports.UnifiedWebpackPluginV5 = v5.UnifiedWebpackPluginV5;
|
|
41
|
+
exports.UnifiedViteWeappTailwindcssPlugin = index.UnifiedViteWeappTailwindcssPlugin;
|
|
42
|
+
exports.createPlugins = index$1.createPlugins;
|
package/dist/index.mjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
export { UnifiedWebpackPluginV5 } from './
|
|
2
|
-
export { UnifiedViteWeappTailwindcssPlugin } from './
|
|
3
|
-
export { createPlugins } from './
|
|
4
|
-
import './options-
|
|
1
|
+
export { U as UnifiedWebpackPluginV5 } from './v5-V8LlDF1a.mjs';
|
|
2
|
+
export { U as UnifiedViteWeappTailwindcssPlugin } from './index-D3TDwy2Y.mjs';
|
|
3
|
+
export { c as createPlugins } from './index-QLyv-Fcp.mjs';
|
|
4
|
+
import './options-B5UOFsZN.mjs';
|
|
5
5
|
import 'micromatch';
|
|
6
6
|
import 'magic-string';
|
|
7
7
|
import './replace.mjs';
|
|
8
8
|
import '@weapp-core/escape';
|
|
9
9
|
import '@ast-core/escape';
|
|
10
|
-
import './shared-
|
|
10
|
+
import './shared-D4ZM_mI-.mjs';
|
|
11
11
|
import '@weapp-core/regex';
|
|
12
12
|
import '@babel/generator';
|
|
13
13
|
import '@babel/parser';
|
|
14
14
|
import '@babel/traverse';
|
|
15
|
-
import './defu-
|
|
16
|
-
import './defaults-
|
|
15
|
+
import './defu-D2_bzAv0.mjs';
|
|
16
|
+
import './defaults-DMBtD8TO.mjs';
|
|
17
17
|
import '@babel/types';
|
|
18
18
|
import 'htmlparser2';
|
|
19
19
|
import 'postcss';
|
|
20
|
-
import './
|
|
20
|
+
import './plugin-Du3zrk3S.mjs';
|
|
21
21
|
import 'postcss-selector-parser';
|
|
22
22
|
import '@csstools/postcss-is-pseudo-class';
|
|
23
23
|
import 'node:path';
|
|
@@ -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-CLxBL7MC.mjs';
|
|
31
31
|
import 'debug';
|
|
32
32
|
import 'node:stream';
|