weapp-tailwindcss 4.9.0-alpha.0 → 4.9.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/{chunk-TRZWVCFI.mjs → chunk-3M464H7S.mjs} +2 -2
- package/dist/{chunk-KDURGAC7.js → chunk-4FB4YO6F.js} +13 -13
- package/dist/{chunk-TDU6NN6W.mjs → chunk-4Z6MHSEO.mjs} +1 -1
- package/dist/{chunk-ZQLZCQL3.mjs → chunk-6OOJ46QK.mjs} +2 -2
- package/dist/{chunk-OQ2K6ETP.js → chunk-A2OSQ5CV.js} +1 -1
- package/dist/{chunk-GFC7MQHN.mjs → chunk-GIUNRP65.mjs} +1 -1
- package/dist/{chunk-BWNTLOVR.js → chunk-IGTIMGCP.js} +3 -3
- package/dist/{chunk-55DZTCIR.js → chunk-NNYRZ4FL.js} +22 -22
- package/dist/{chunk-2WMBYV66.mjs → chunk-QJTJC5UT.mjs} +1 -1
- package/dist/{chunk-MJW6ZJID.js → chunk-QZJTOS3U.js} +3 -3
- package/dist/{chunk-LUFUZYVB.js → chunk-RMTGZQHJ.js} +7 -7
- package/dist/{chunk-I7OZD2MH.mjs → chunk-YJ4NK2AE.mjs} +3 -3
- package/dist/cli.js +9 -9
- package/dist/cli.mjs +1 -1
- package/dist/core.js +8 -8
- package/dist/core.mjs +2 -2
- package/dist/gulp.js +4 -4
- package/dist/gulp.mjs +3 -3
- package/dist/index.js +7 -7
- package/dist/index.mjs +6 -6
- package/dist/vite.js +4 -4
- package/dist/vite.mjs +3 -3
- package/dist/webpack.js +5 -5
- package/dist/webpack.mjs +4 -4
- package/dist/webpack4.js +23 -23
- package/dist/webpack4.mjs +3 -3
- package/package.json +3 -3
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-RRHPTTCP.mjs";
|
|
4
4
|
import {
|
|
5
5
|
setupPatchRecorder
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GIUNRP65.mjs";
|
|
7
7
|
import {
|
|
8
8
|
collectRuntimeClassSet,
|
|
9
9
|
createDebug,
|
|
10
10
|
getCompilerContext,
|
|
11
11
|
refreshTailwindRuntimeState
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4Z6MHSEO.mjs";
|
|
13
13
|
|
|
14
14
|
// src/bundlers/gulp/index.ts
|
|
15
15
|
import { Buffer } from "buffer";
|
|
@@ -12,7 +12,7 @@ var _chunkORSWL3MIjs = require('./chunk-ORSWL3MI.js');
|
|
|
12
12
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkIGTIMGCPjs = require('./chunk-IGTIMGCP.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -23,7 +23,7 @@ var _chunkBWNTLOVRjs = require('./chunk-BWNTLOVR.js');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkA2OSQ5CVjs = require('./chunk-A2OSQ5CV.js');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
var _chunkFMBPNII7js = require('./chunk-FMBPNII7.js');
|
|
@@ -55,7 +55,7 @@ function updateStaticAttribute(ms, prop) {
|
|
|
55
55
|
const start = prop.value.loc.start.offset + 1;
|
|
56
56
|
const end = prop.value.loc.end.offset - 1;
|
|
57
57
|
if (start < end) {
|
|
58
|
-
ms.update(start, end,
|
|
58
|
+
ms.update(start, end, _chunkA2OSQ5CVjs.replaceWxml.call(void 0, prop.value.content));
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
@@ -67,7 +67,7 @@ function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
|
67
67
|
if (start >= end) {
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
|
-
const generated =
|
|
70
|
+
const generated = _chunkA2OSQ5CVjs.generateCode.call(void 0, prop.exp.content, {
|
|
71
71
|
jsHandler,
|
|
72
72
|
runtimeSet,
|
|
73
73
|
wrapExpression: true
|
|
@@ -96,7 +96,7 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
98
|
const { customAttributesEntities, disabledDefaultTemplateHandler = false } = options;
|
|
99
|
-
const matchCustomAttribute =
|
|
99
|
+
const matchCustomAttribute = _chunkA2OSQ5CVjs.createAttributeMatcher.call(void 0, customAttributesEntities);
|
|
100
100
|
const ms = new (0, _magicstring2.default)(code);
|
|
101
101
|
const { descriptor, errors } = _compilersfc.parse.call(void 0, code);
|
|
102
102
|
if (errors.length === 0) {
|
|
@@ -379,7 +379,7 @@ function createUniAppXAssetTask(file, originalSource, outDir, options) {
|
|
|
379
379
|
}
|
|
380
380
|
|
|
381
381
|
// src/bundlers/vite/index.ts
|
|
382
|
-
var debug =
|
|
382
|
+
var debug = _chunkA2OSQ5CVjs.createDebug.call(void 0, );
|
|
383
383
|
var weappTailwindcssPackageDir = _chunkORSWL3MIjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
384
384
|
var weappTailwindcssDirPosix = slash(weappTailwindcssPackageDir);
|
|
385
385
|
function joinPosixPath(base, subpath) {
|
|
@@ -462,7 +462,7 @@ function applyLinkedResults(linked, entries, onLinkedUpdate, onApplied) {
|
|
|
462
462
|
}
|
|
463
463
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
464
464
|
const rewriteCssImportsSpecified = Object.prototype.hasOwnProperty.call(options, "rewriteCssImports");
|
|
465
|
-
const opts =
|
|
465
|
+
const opts = _chunkA2OSQ5CVjs.getCompilerContext.call(void 0, options);
|
|
466
466
|
const {
|
|
467
467
|
disabled,
|
|
468
468
|
customAttributes,
|
|
@@ -486,7 +486,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
486
486
|
const shouldRewriteCssImports = opts.rewriteCssImports !== false && !disabledOptions.rewriteCssImports && (rewriteCssImportsSpecified || tailwindcssMajorVersion >= 4);
|
|
487
487
|
const rewritePlugins = !shouldRewriteCssImports ? [] : [
|
|
488
488
|
{
|
|
489
|
-
name: `${
|
|
489
|
+
name: `${_chunkA2OSQ5CVjs.vitePluginName}:rewrite-css-imports`,
|
|
490
490
|
enforce: "pre",
|
|
491
491
|
resolveId: {
|
|
492
492
|
order: "pre",
|
|
@@ -528,8 +528,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
528
528
|
if (disabledOptions.plugin) {
|
|
529
529
|
return rewritePlugins.length ? rewritePlugins : void 0;
|
|
530
530
|
}
|
|
531
|
-
const customAttributesEntities =
|
|
532
|
-
const patchRecorderState =
|
|
531
|
+
const customAttributesEntities = _chunkA2OSQ5CVjs.toCustomAttributesEntities.call(void 0, customAttributes);
|
|
532
|
+
const patchRecorderState = _chunkIGTIMGCPjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
533
533
|
source: "runtime",
|
|
534
534
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
535
535
|
});
|
|
@@ -543,7 +543,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
543
543
|
let runtimeSetPromise;
|
|
544
544
|
let resolvedConfig;
|
|
545
545
|
async function refreshRuntimeState(force) {
|
|
546
|
-
const refreshed = await
|
|
546
|
+
const refreshed = await _chunkA2OSQ5CVjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
547
547
|
if (refreshed) {
|
|
548
548
|
runtimeSet = void 0;
|
|
549
549
|
runtimeSetPromise = void 0;
|
|
@@ -556,7 +556,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
556
556
|
return runtimeSet;
|
|
557
557
|
}
|
|
558
558
|
if (force || !runtimeSetPromise) {
|
|
559
|
-
const task2 =
|
|
559
|
+
const task2 = _chunkA2OSQ5CVjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
|
|
560
560
|
force: force || !runtimeSet,
|
|
561
561
|
skipRefresh: force
|
|
562
562
|
});
|
|
@@ -588,7 +588,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
588
588
|
const plugins = [
|
|
589
589
|
...rewritePlugins,
|
|
590
590
|
{
|
|
591
|
-
name: `${
|
|
591
|
+
name: `${_chunkA2OSQ5CVjs.vitePluginName}:post`,
|
|
592
592
|
enforce: "post",
|
|
593
593
|
configResolved(config) {
|
|
594
594
|
resolvedConfig = config;
|
|
@@ -187,7 +187,7 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
|
|
|
187
187
|
// package.json
|
|
188
188
|
var package_default = {
|
|
189
189
|
name: "weapp-tailwindcss",
|
|
190
|
-
version: "4.9.0
|
|
190
|
+
version: "4.9.0",
|
|
191
191
|
description: "\u628A tailwindcss \u539F\u5B50\u5316\u6837\u5F0F\u601D\u60F3\uFF0C\u5E26\u7ED9\u5C0F\u7A0B\u5E8F\u5F00\u53D1\u8005\u4EEC! bring tailwindcss to miniprogram developers!",
|
|
192
192
|
author: "ice breaker <1324318532@qq.com>",
|
|
193
193
|
license: "MIT",
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-RRHPTTCP.mjs";
|
|
13
13
|
import {
|
|
14
14
|
setupPatchRecorder
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-GIUNRP65.mjs";
|
|
16
16
|
import {
|
|
17
17
|
collectRuntimeClassSet,
|
|
18
18
|
createAttributeMatcher,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
replaceWxml,
|
|
24
24
|
toCustomAttributesEntities,
|
|
25
25
|
vitePluginName
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-4Z6MHSEO.mjs";
|
|
27
27
|
import {
|
|
28
28
|
getGroupedEntries
|
|
29
29
|
} from "./chunk-RR5HCKVQ.mjs";
|
|
@@ -187,7 +187,7 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
|
|
|
187
187
|
// package.json
|
|
188
188
|
var package_default = {
|
|
189
189
|
name: "weapp-tailwindcss",
|
|
190
|
-
version: "4.9.0
|
|
190
|
+
version: "4.9.0",
|
|
191
191
|
description: "\u628A tailwindcss \u539F\u5B50\u5316\u6837\u5F0F\u601D\u60F3\uFF0C\u5E26\u7ED9\u5C0F\u7A0B\u5E8F\u5F00\u53D1\u8005\u4EEC! bring tailwindcss to miniprogram developers!",
|
|
192
192
|
author: "ice breaker <1324318532@qq.com>",
|
|
193
193
|
license: "MIT",
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkA2OSQ5CVjs = require('./chunk-A2OSQ5CV.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkPT4IJT3Qjs = require('./chunk-PT4IJT3Q.js');
|
|
8
8
|
|
|
9
9
|
// src/tailwindcss/recorder.ts
|
|
10
10
|
function setupPatchRecorder(patcher, baseDir, options) {
|
|
11
|
-
const recorder =
|
|
11
|
+
const recorder = _chunkA2OSQ5CVjs.createPatchTargetRecorder.call(void 0, baseDir, patcher, options);
|
|
12
12
|
if (_optionalChain([recorder, 'optionalAccess', _ => _.message]) && _optionalChain([options, 'optionalAccess', _2 => _2.logMessage]) !== false) {
|
|
13
13
|
const prefix = _optionalChain([options, 'optionalAccess', _3 => _3.messagePrefix]) ? `${options.messagePrefix} ` : "";
|
|
14
14
|
_chunkPT4IJT3Qjs.logger.info("%s%s", prefix, recorder.message);
|
|
@@ -16,7 +16,7 @@ function setupPatchRecorder(patcher, baseDir, options) {
|
|
|
16
16
|
const onPatchCompleted = _optionalChain([recorder, 'optionalAccess', _4 => _4.onPatched]) ? async () => {
|
|
17
17
|
await recorder.onPatched();
|
|
18
18
|
} : void 0;
|
|
19
|
-
const patchPromise = patcher ?
|
|
19
|
+
const patchPromise = patcher ? _chunkA2OSQ5CVjs.createTailwindPatchPromise.call(void 0, patcher, onPatchCompleted) : Promise.resolve();
|
|
20
20
|
return {
|
|
21
21
|
recorder,
|
|
22
22
|
patchPromise,
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkQZJTOS3Ujs = require('./chunk-QZJTOS3U.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -22,14 +22,14 @@ var _chunkORSWL3MIjs = require('./chunk-ORSWL3MI.js');
|
|
|
22
22
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunkIGTIMGCPjs = require('./chunk-IGTIMGCP.js');
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkA2OSQ5CVjs = require('./chunk-A2OSQ5CV.js');
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
var _chunkFMBPNII7js = require('./chunk-FMBPNII7.js');
|
|
@@ -38,11 +38,11 @@ var _chunkFMBPNII7js = require('./chunk-FMBPNII7.js');
|
|
|
38
38
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
39
39
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
40
40
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
41
|
-
var debug =
|
|
41
|
+
var debug = _chunkA2OSQ5CVjs.createDebug.call(void 0, );
|
|
42
42
|
var weappTailwindcssPackageDir = _chunkORSWL3MIjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
43
43
|
var UnifiedWebpackPluginV5 = class {
|
|
44
44
|
constructor(options = {}) {
|
|
45
|
-
this.options =
|
|
45
|
+
this.options = _chunkA2OSQ5CVjs.getCompilerContext.call(void 0, options);
|
|
46
46
|
this.appType = this.options.appType;
|
|
47
47
|
}
|
|
48
48
|
apply(compiler) {
|
|
@@ -66,19 +66,19 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
66
66
|
const disabledOptions = _chunkORSWL3MIjs.resolveDisabledOptions.call(void 0, disabled);
|
|
67
67
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
68
68
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
69
|
-
const isMpxApp =
|
|
69
|
+
const isMpxApp = _chunkQZJTOS3Ujs.isMpx.call(void 0, this.appType);
|
|
70
70
|
if (shouldRewriteCssImports) {
|
|
71
|
-
|
|
71
|
+
_chunkQZJTOS3Ujs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
72
72
|
pkgDir: weappTailwindcssPackageDir,
|
|
73
73
|
enabled: true,
|
|
74
74
|
appType: this.appType
|
|
75
75
|
});
|
|
76
|
-
|
|
76
|
+
_chunkQZJTOS3Ujs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
77
77
|
}
|
|
78
78
|
if (disabledOptions.plugin) {
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
const patchRecorderState =
|
|
81
|
+
const patchRecorderState = _chunkIGTIMGCPjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
82
82
|
source: "runtime",
|
|
83
83
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
84
84
|
});
|
|
@@ -89,14 +89,14 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
89
89
|
onPatchCompleted: patchRecorderState.onPatchCompleted
|
|
90
90
|
};
|
|
91
91
|
const refreshRuntimeState = async (force) => {
|
|
92
|
-
await
|
|
92
|
+
await _chunkA2OSQ5CVjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
93
93
|
};
|
|
94
94
|
const { Compilation, sources, NormalModule } = compiler.webpack;
|
|
95
95
|
const { ConcatSource } = sources;
|
|
96
96
|
async function getClassSetInLoader() {
|
|
97
97
|
await refreshRuntimeState(true);
|
|
98
98
|
await runtimeState.patchPromise;
|
|
99
|
-
await
|
|
99
|
+
await _chunkA2OSQ5CVjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
100
100
|
}
|
|
101
101
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
102
102
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -109,16 +109,16 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
109
109
|
const classSetLoaderOptions = {
|
|
110
110
|
getClassSet: getClassSetInLoader
|
|
111
111
|
};
|
|
112
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
112
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunkQZJTOS3Ujs.createLoaderAnchorFinders.call(void 0, this.appType);
|
|
113
113
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
114
114
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
115
115
|
} : void 0;
|
|
116
116
|
onLoad();
|
|
117
117
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
118
|
-
|
|
118
|
+
_chunkQZJTOS3Ujs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir);
|
|
119
119
|
}
|
|
120
120
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
121
|
-
|
|
121
|
+
_chunkQZJTOS3Ujs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
122
122
|
}
|
|
123
123
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
124
124
|
loader: runtimeClassSetLoader,
|
|
@@ -137,17 +137,17 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
137
137
|
type: null
|
|
138
138
|
};
|
|
139
139
|
};
|
|
140
|
-
compiler.hooks.compilation.tap(
|
|
141
|
-
NormalModule.getCompilationHooks(compilation).loader.tap(
|
|
140
|
+
compiler.hooks.compilation.tap(_chunkA2OSQ5CVjs.pluginName, (compilation) => {
|
|
141
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(_chunkA2OSQ5CVjs.pluginName, (_loaderContext, module) => {
|
|
142
142
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
143
143
|
if (!hasRuntimeLoader) {
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
146
|
-
|
|
146
|
+
_chunkQZJTOS3Ujs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir, shouldRewriteCssImports && isMpxApp);
|
|
147
147
|
const loaderEntries = module.loaders || [];
|
|
148
148
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
149
149
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
150
|
-
const isCssModule =
|
|
150
|
+
const isCssModule = _chunkQZJTOS3Ujs.isCssLikeModuleResource.call(void 0, module.resource, this.options.cssMatcher, this.appType);
|
|
151
151
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
152
152
|
debug("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
153
153
|
}
|
|
@@ -179,7 +179,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
179
179
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
if (runtimeClassSetLoaderExists && !
|
|
182
|
+
if (runtimeClassSetLoaderExists && !_chunkQZJTOS3Ujs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
183
183
|
const classSetLoaderEntry = createRuntimeClassSetLoaderEntry();
|
|
184
184
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
185
185
|
if (anchorIndex === -1) {
|
|
@@ -192,7 +192,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
192
192
|
});
|
|
193
193
|
compilation.hooks.processAssets.tapPromise(
|
|
194
194
|
{
|
|
195
|
-
name:
|
|
195
|
+
name: _chunkA2OSQ5CVjs.pluginName,
|
|
196
196
|
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
197
197
|
},
|
|
198
198
|
async (assets) => {
|
|
@@ -261,7 +261,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
261
261
|
const groupedEntries = _chunkFMBPNII7js.getGroupedEntries.call(void 0, entries, this.options);
|
|
262
262
|
await refreshRuntimeState(true);
|
|
263
263
|
await runtimeState.patchPromise;
|
|
264
|
-
const runtimeSet = await
|
|
264
|
+
const runtimeSet = await _chunkA2OSQ5CVjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
265
265
|
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
266
266
|
const tasks = [];
|
|
267
267
|
if (Array.isArray(groupedEntries.html)) {
|
|
@@ -298,7 +298,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
298
298
|
const jsTaskFactories = [];
|
|
299
299
|
if (Array.isArray(groupedEntries.js)) {
|
|
300
300
|
for (const [file] of groupedEntries.js) {
|
|
301
|
-
const cacheKey =
|
|
301
|
+
const cacheKey = _chunkQZJTOS3Ujs.getCacheKey.call(void 0, file);
|
|
302
302
|
const asset = compilation.getAsset(file);
|
|
303
303
|
if (!asset) {
|
|
304
304
|
continue;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkORSWL3MIjs = require('./chunk-ORSWL3MI.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkA2OSQ5CVjs = require('./chunk-A2OSQ5CV.js');
|
|
7
7
|
|
|
8
8
|
// src/shared/mpx.ts
|
|
9
9
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
@@ -154,8 +154,8 @@ function applyTailwindcssCssImportRewrite(compiler, options) {
|
|
|
154
154
|
if (!options.enabled) {
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
|
-
compiler.hooks.normalModuleFactory.tap(
|
|
158
|
-
factory.hooks.beforeResolve.tap(
|
|
157
|
+
compiler.hooks.normalModuleFactory.tap(_chunkA2OSQ5CVjs.pluginName, (factory) => {
|
|
158
|
+
factory.hooks.beforeResolve.tap(_chunkA2OSQ5CVjs.pluginName, (data) => {
|
|
159
159
|
rewriteTailwindcssRequestForCss(data, options.pkgDir, options.appType);
|
|
160
160
|
});
|
|
161
161
|
});
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkIGTIMGCPjs = require('./chunk-IGTIMGCP.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkA2OSQ5CVjs = require('./chunk-A2OSQ5CV.js');
|
|
13
13
|
|
|
14
14
|
// src/bundlers/gulp/index.ts
|
|
15
15
|
var _buffer = require('buffer');
|
|
@@ -17,12 +17,12 @@ var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
|
17
17
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
18
18
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
19
19
|
var _stream = require('stream'); var _stream2 = _interopRequireDefault(_stream);
|
|
20
|
-
var debug =
|
|
20
|
+
var debug = _chunkA2OSQ5CVjs.createDebug.call(void 0, );
|
|
21
21
|
var Transform = _stream2.default.Transform;
|
|
22
22
|
function createPlugins(options = {}) {
|
|
23
|
-
const opts =
|
|
23
|
+
const opts = _chunkA2OSQ5CVjs.getCompilerContext.call(void 0, options);
|
|
24
24
|
const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
25
|
-
const patchRecorderState =
|
|
25
|
+
const patchRecorderState = _chunkIGTIMGCPjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
26
26
|
source: "runtime",
|
|
27
27
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
28
28
|
});
|
|
@@ -36,7 +36,7 @@ function createPlugins(options = {}) {
|
|
|
36
36
|
const MODULE_EXTENSIONS = [".js", ".mjs", ".cjs", ".ts", ".tsx", ".jsx"];
|
|
37
37
|
let runtimeSetInitialized = false;
|
|
38
38
|
async function refreshRuntimeState(force) {
|
|
39
|
-
await
|
|
39
|
+
await _chunkA2OSQ5CVjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
40
40
|
}
|
|
41
41
|
async function refreshRuntimeSet(force = false) {
|
|
42
42
|
await refreshRuntimeState(force);
|
|
@@ -44,7 +44,7 @@ function createPlugins(options = {}) {
|
|
|
44
44
|
if (!force && runtimeSetInitialized && runtimeSet.size > 0) {
|
|
45
45
|
return runtimeSet;
|
|
46
46
|
}
|
|
47
|
-
runtimeSet = await
|
|
47
|
+
runtimeSet = await _chunkA2OSQ5CVjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force, skipRefresh: force });
|
|
48
48
|
runtimeSetInitialized = true;
|
|
49
49
|
return runtimeSet;
|
|
50
50
|
}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
isMpx,
|
|
10
10
|
patchMpxLoaderResolve,
|
|
11
11
|
setupMpxTailwindcssRedirect
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QJTJC5UT.mjs";
|
|
13
13
|
import {
|
|
14
14
|
pushConcurrentTaskFactories,
|
|
15
15
|
resolveDisabledOptions,
|
|
@@ -22,14 +22,14 @@ import {
|
|
|
22
22
|
} from "./chunk-RRHPTTCP.mjs";
|
|
23
23
|
import {
|
|
24
24
|
setupPatchRecorder
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-GIUNRP65.mjs";
|
|
26
26
|
import {
|
|
27
27
|
collectRuntimeClassSet,
|
|
28
28
|
createDebug,
|
|
29
29
|
getCompilerContext,
|
|
30
30
|
pluginName,
|
|
31
31
|
refreshTailwindRuntimeState
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-4Z6MHSEO.mjs";
|
|
33
33
|
import {
|
|
34
34
|
getGroupedEntries
|
|
35
35
|
} from "./chunk-RR5HCKVQ.mjs";
|
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkA2OSQ5CVjs = require('./chunk-A2OSQ5CV.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -334,9 +334,9 @@ async function patchWorkspace(options) {
|
|
|
334
334
|
try {
|
|
335
335
|
const patcher = createWorkspacePatcher(dir);
|
|
336
336
|
if (options.clearCache) {
|
|
337
|
-
await
|
|
337
|
+
await _chunkA2OSQ5CVjs.clearTailwindcssPatcherCache.call(void 0, patcher, { removeDirectory: true });
|
|
338
338
|
}
|
|
339
|
-
const recorder =
|
|
339
|
+
const recorder = _chunkA2OSQ5CVjs.createPatchTargetRecorder.call(void 0, dir, patcher, {
|
|
340
340
|
source: "cli",
|
|
341
341
|
cwd: dir,
|
|
342
342
|
recordTarget: options.recordTarget !== false,
|
|
@@ -345,7 +345,7 @@ async function patchWorkspace(options) {
|
|
|
345
345
|
if (_optionalChain([recorder, 'optionalAccess', _13 => _13.message])) {
|
|
346
346
|
_chunkPT4IJT3Qjs.logger.info("[workspace] %s %s", displayName, recorder.message);
|
|
347
347
|
}
|
|
348
|
-
|
|
348
|
+
_chunkA2OSQ5CVjs.logTailwindcssTarget.call(void 0, "cli", patcher, dir);
|
|
349
349
|
await patcher.patch();
|
|
350
350
|
if (_optionalChain([recorder, 'optionalAccess', _14 => _14.onPatched])) {
|
|
351
351
|
await recorder.onPatched();
|
|
@@ -500,9 +500,9 @@ var mountOptions = {
|
|
|
500
500
|
}
|
|
501
501
|
const patcher = await createPatcherWithDefaultExtendLengthUnits(ctx);
|
|
502
502
|
if (shouldClearCache) {
|
|
503
|
-
await
|
|
503
|
+
await _chunkA2OSQ5CVjs.clearTailwindcssPatcherCache.call(void 0, patcher, { removeDirectory: true });
|
|
504
504
|
}
|
|
505
|
-
const recorder =
|
|
505
|
+
const recorder = _chunkA2OSQ5CVjs.createPatchTargetRecorder.call(void 0, ctx.cwd, patcher, {
|
|
506
506
|
source: "cli",
|
|
507
507
|
cwd: ctx.cwd,
|
|
508
508
|
recordTarget: shouldRecordTarget,
|
|
@@ -511,7 +511,7 @@ var mountOptions = {
|
|
|
511
511
|
if (_optionalChain([recorder, 'optionalAccess', _18 => _18.message])) {
|
|
512
512
|
_chunkPT4IJT3Qjs.logger.info(recorder.message);
|
|
513
513
|
}
|
|
514
|
-
|
|
514
|
+
_chunkA2OSQ5CVjs.logTailwindcssTarget.call(void 0, "cli", patcher, ctx.cwd);
|
|
515
515
|
await patcher.patch();
|
|
516
516
|
if (_optionalChain([recorder, 'optionalAccess', _19 => _19.onPatched])) {
|
|
517
517
|
const recordPath = await recorder.onPatched();
|
|
@@ -659,9 +659,9 @@ async function generateVscodeIntellisenseEntry(options) {
|
|
|
659
659
|
|
|
660
660
|
// src/cli.ts
|
|
661
661
|
_process2.default.title = "node (weapp-tailwindcss)";
|
|
662
|
-
if (_semver2.default.lt(_process2.default.versions.node,
|
|
662
|
+
if (_semver2.default.lt(_process2.default.versions.node, _chunkA2OSQ5CVjs.WEAPP_TW_REQUIRED_NODE_VERSION)) {
|
|
663
663
|
_chunkPT4IJT3Qjs.logger.warn(
|
|
664
|
-
`You are using Node.js ${_process2.default.versions.node}. For weapp-tailwindcss, Node.js version >= v${
|
|
664
|
+
`You are using Node.js ${_process2.default.versions.node}. For weapp-tailwindcss, Node.js version >= v${_chunkA2OSQ5CVjs.WEAPP_TW_REQUIRED_NODE_VERSION} is required.`
|
|
665
665
|
);
|
|
666
666
|
}
|
|
667
667
|
var cli = _tailwindcsspatch.createTailwindcssPatchCli.call(void 0, {
|
package/dist/cli.mjs
CHANGED
package/dist/core.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkIGTIMGCPjs = require('./chunk-IGTIMGCP.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkA2OSQ5CVjs = require('./chunk-A2OSQ5CV.js');
|
|
9
9
|
require('./chunk-PT4IJT3Q.js');
|
|
10
10
|
require('./chunk-6R4BK6D6.js');
|
|
11
11
|
require('./chunk-FMBPNII7.js');
|
|
@@ -15,9 +15,9 @@ require('./chunk-MB4BR57E.js');
|
|
|
15
15
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
16
16
|
var _shared = require('@weapp-tailwindcss/shared');
|
|
17
17
|
function createContext(options = {}) {
|
|
18
|
-
const opts =
|
|
18
|
+
const opts = _chunkA2OSQ5CVjs.getCompilerContext.call(void 0, options);
|
|
19
19
|
const { templateHandler, styleHandler, jsHandler, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
20
|
-
const patchRecorderState =
|
|
20
|
+
const patchRecorderState = _chunkIGTIMGCPjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
21
21
|
source: "runtime",
|
|
22
22
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
23
23
|
});
|
|
@@ -29,7 +29,7 @@ function createContext(options = {}) {
|
|
|
29
29
|
onPatchCompleted: patchRecorderState.onPatchCompleted
|
|
30
30
|
};
|
|
31
31
|
async function refreshRuntimeState(force) {
|
|
32
|
-
await
|
|
32
|
+
await _chunkA2OSQ5CVjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
33
33
|
}
|
|
34
34
|
async function transformWxss(rawCss, options2) {
|
|
35
35
|
await runtimeState.patchPromise;
|
|
@@ -38,7 +38,7 @@ function createContext(options = {}) {
|
|
|
38
38
|
}));
|
|
39
39
|
await refreshRuntimeState(true);
|
|
40
40
|
await runtimeState.patchPromise;
|
|
41
|
-
runtimeSet = await
|
|
41
|
+
runtimeSet = await _chunkA2OSQ5CVjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
42
42
|
return result;
|
|
43
43
|
}
|
|
44
44
|
async function transformJs(rawJs, options2 = {}) {
|
|
@@ -48,7 +48,7 @@ function createContext(options = {}) {
|
|
|
48
48
|
} else {
|
|
49
49
|
await refreshRuntimeState(true);
|
|
50
50
|
await runtimeState.patchPromise;
|
|
51
|
-
runtimeSet = await
|
|
51
|
+
runtimeSet = await _chunkA2OSQ5CVjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
52
52
|
}
|
|
53
53
|
return await jsHandler(rawJs, runtimeSet, options2);
|
|
54
54
|
}
|
|
@@ -57,7 +57,7 @@ function createContext(options = {}) {
|
|
|
57
57
|
if (!_optionalChain([options2, 'optionalAccess', _2 => _2.runtimeSet]) && runtimeSet.size === 0) {
|
|
58
58
|
await refreshRuntimeState(true);
|
|
59
59
|
await runtimeState.patchPromise;
|
|
60
|
-
runtimeSet = await
|
|
60
|
+
runtimeSet = await _chunkA2OSQ5CVjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
61
61
|
}
|
|
62
62
|
return templateHandler(rawWxml, _shared.defuOverrideArray.call(void 0, options2, {
|
|
63
63
|
runtimeSet
|
package/dist/core.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
setupPatchRecorder
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GIUNRP65.mjs";
|
|
4
4
|
import {
|
|
5
5
|
collectRuntimeClassSet,
|
|
6
6
|
getCompilerContext,
|
|
7
7
|
refreshTailwindRuntimeState
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-4Z6MHSEO.mjs";
|
|
9
9
|
import "./chunk-SZOXLSNK.mjs";
|
|
10
10
|
import "./chunk-TFOTUR4L.mjs";
|
|
11
11
|
import "./chunk-RR5HCKVQ.mjs";
|
package/dist/gulp.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkRMTGZQHJjs = require('./chunk-RMTGZQHJ.js');
|
|
4
4
|
require('./chunk-LTJQUORK.js');
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-IGTIMGCP.js');
|
|
6
|
+
require('./chunk-A2OSQ5CV.js');
|
|
7
7
|
require('./chunk-PT4IJT3Q.js');
|
|
8
8
|
require('./chunk-6R4BK6D6.js');
|
|
9
9
|
require('./chunk-FMBPNII7.js');
|
|
10
10
|
require('./chunk-MB4BR57E.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.createPlugins =
|
|
13
|
+
exports.createPlugins = _chunkRMTGZQHJjs.createPlugins;
|
package/dist/gulp.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPlugins
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3M464H7S.mjs";
|
|
4
4
|
import "./chunk-RRHPTTCP.mjs";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-GIUNRP65.mjs";
|
|
6
|
+
import "./chunk-4Z6MHSEO.mjs";
|
|
7
7
|
import "./chunk-SZOXLSNK.mjs";
|
|
8
8
|
import "./chunk-TFOTUR4L.mjs";
|
|
9
9
|
import "./chunk-RR5HCKVQ.mjs";
|
package/dist/index.js
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('./chunk-
|
|
5
|
+
var _chunkNNYRZ4FLjs = require('./chunk-NNYRZ4FL.js');
|
|
6
|
+
require('./chunk-QZJTOS3U.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkRMTGZQHJjs = require('./chunk-RMTGZQHJ.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunk4FB4YO6Fjs = require('./chunk-4FB4YO6F.js');
|
|
13
13
|
require('./chunk-ORSWL3MI.js');
|
|
14
14
|
require('./chunk-LTJQUORK.js');
|
|
15
|
-
require('./chunk-
|
|
16
|
-
require('./chunk-
|
|
15
|
+
require('./chunk-IGTIMGCP.js');
|
|
16
|
+
require('./chunk-A2OSQ5CV.js');
|
|
17
17
|
require('./chunk-PT4IJT3Q.js');
|
|
18
18
|
require('./chunk-6R4BK6D6.js');
|
|
19
19
|
require('./chunk-FMBPNII7.js');
|
|
@@ -23,4 +23,4 @@ require('./chunk-MB4BR57E.js');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
exports.UnifiedViteWeappTailwindcssPlugin =
|
|
26
|
+
exports.UnifiedViteWeappTailwindcssPlugin = _chunk4FB4YO6Fjs.UnifiedViteWeappTailwindcssPlugin; exports.UnifiedWebpackPluginV5 = _chunkNNYRZ4FLjs.UnifiedWebpackPluginV5; exports.createPlugins = _chunkRMTGZQHJjs.createPlugins; exports.weappTailwindcssPackageDir = _chunkNNYRZ4FLjs.weappTailwindcssPackageDir;
|
package/dist/index.mjs
CHANGED
|
@@ -2,18 +2,18 @@ import "./chunk-YAN7TO2B.mjs";
|
|
|
2
2
|
import {
|
|
3
3
|
UnifiedWebpackPluginV5,
|
|
4
4
|
weappTailwindcssPackageDir
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-YJ4NK2AE.mjs";
|
|
6
|
+
import "./chunk-QJTJC5UT.mjs";
|
|
7
7
|
import {
|
|
8
8
|
createPlugins
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3M464H7S.mjs";
|
|
10
10
|
import {
|
|
11
11
|
UnifiedViteWeappTailwindcssPlugin
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6OOJ46QK.mjs";
|
|
13
13
|
import "./chunk-3SKEY32E.mjs";
|
|
14
14
|
import "./chunk-RRHPTTCP.mjs";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-GIUNRP65.mjs";
|
|
16
|
+
import "./chunk-4Z6MHSEO.mjs";
|
|
17
17
|
import "./chunk-SZOXLSNK.mjs";
|
|
18
18
|
import "./chunk-TFOTUR4L.mjs";
|
|
19
19
|
import "./chunk-RR5HCKVQ.mjs";
|
package/dist/vite.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk4FB4YO6Fjs = require('./chunk-4FB4YO6F.js');
|
|
4
4
|
require('./chunk-ORSWL3MI.js');
|
|
5
5
|
require('./chunk-LTJQUORK.js');
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-IGTIMGCP.js');
|
|
7
|
+
require('./chunk-A2OSQ5CV.js');
|
|
8
8
|
require('./chunk-PT4IJT3Q.js');
|
|
9
9
|
require('./chunk-6R4BK6D6.js');
|
|
10
10
|
require('./chunk-FMBPNII7.js');
|
|
11
11
|
require('./chunk-MB4BR57E.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.UnifiedViteWeappTailwindcssPlugin =
|
|
14
|
+
exports.UnifiedViteWeappTailwindcssPlugin = _chunk4FB4YO6Fjs.UnifiedViteWeappTailwindcssPlugin;
|
package/dist/vite.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedViteWeappTailwindcssPlugin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6OOJ46QK.mjs";
|
|
4
4
|
import "./chunk-3SKEY32E.mjs";
|
|
5
5
|
import "./chunk-RRHPTTCP.mjs";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-GIUNRP65.mjs";
|
|
7
|
+
import "./chunk-4Z6MHSEO.mjs";
|
|
8
8
|
import "./chunk-SZOXLSNK.mjs";
|
|
9
9
|
import "./chunk-TFOTUR4L.mjs";
|
|
10
10
|
import "./chunk-RR5HCKVQ.mjs";
|
package/dist/webpack.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var _chunkNNYRZ4FLjs = require('./chunk-NNYRZ4FL.js');
|
|
5
|
+
require('./chunk-QZJTOS3U.js');
|
|
6
6
|
require('./chunk-ORSWL3MI.js');
|
|
7
7
|
require('./chunk-LTJQUORK.js');
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-IGTIMGCP.js');
|
|
9
|
+
require('./chunk-A2OSQ5CV.js');
|
|
10
10
|
require('./chunk-PT4IJT3Q.js');
|
|
11
11
|
require('./chunk-6R4BK6D6.js');
|
|
12
12
|
require('./chunk-FMBPNII7.js');
|
|
@@ -14,4 +14,4 @@ require('./chunk-MB4BR57E.js');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.UnifiedWebpackPluginV5 =
|
|
17
|
+
exports.UnifiedWebpackPluginV5 = _chunkNNYRZ4FLjs.UnifiedWebpackPluginV5; exports.weappTailwindcssPackageDir = _chunkNNYRZ4FLjs.weappTailwindcssPackageDir;
|
package/dist/webpack.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedWebpackPluginV5,
|
|
3
3
|
weappTailwindcssPackageDir
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-YJ4NK2AE.mjs";
|
|
5
|
+
import "./chunk-QJTJC5UT.mjs";
|
|
6
6
|
import "./chunk-3SKEY32E.mjs";
|
|
7
7
|
import "./chunk-RRHPTTCP.mjs";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-GIUNRP65.mjs";
|
|
9
|
+
import "./chunk-4Z6MHSEO.mjs";
|
|
10
10
|
import "./chunk-SZOXLSNK.mjs";
|
|
11
11
|
import "./chunk-TFOTUR4L.mjs";
|
|
12
12
|
import "./chunk-RR5HCKVQ.mjs";
|
package/dist/webpack4.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkQZJTOS3Ujs = require('./chunk-QZJTOS3U.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -22,14 +22,14 @@ var _chunkORSWL3MIjs = require('./chunk-ORSWL3MI.js');
|
|
|
22
22
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunkIGTIMGCPjs = require('./chunk-IGTIMGCP.js');
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkA2OSQ5CVjs = require('./chunk-A2OSQ5CV.js');
|
|
33
33
|
require('./chunk-PT4IJT3Q.js');
|
|
34
34
|
require('./chunk-6R4BK6D6.js');
|
|
35
35
|
|
|
@@ -42,11 +42,11 @@ var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
|
42
42
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
43
43
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
44
44
|
var _webpacksources = require('webpack-sources');
|
|
45
|
-
var debug =
|
|
45
|
+
var debug = _chunkA2OSQ5CVjs.createDebug.call(void 0, );
|
|
46
46
|
var weappTailwindcssPackageDir = _chunkORSWL3MIjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
47
47
|
var UnifiedWebpackPluginV4 = class {
|
|
48
48
|
constructor(options = {}) {
|
|
49
|
-
this.options =
|
|
49
|
+
this.options = _chunkA2OSQ5CVjs.getCompilerContext.call(void 0, options);
|
|
50
50
|
this.appType = this.options.appType;
|
|
51
51
|
}
|
|
52
52
|
apply(compiler) {
|
|
@@ -70,19 +70,19 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
70
70
|
const disabledOptions = _chunkORSWL3MIjs.resolveDisabledOptions.call(void 0, disabled);
|
|
71
71
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
72
72
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
73
|
-
const isMpxApp =
|
|
73
|
+
const isMpxApp = _chunkQZJTOS3Ujs.isMpx.call(void 0, this.appType);
|
|
74
74
|
if (shouldRewriteCssImports) {
|
|
75
|
-
|
|
75
|
+
_chunkQZJTOS3Ujs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
76
76
|
pkgDir: weappTailwindcssPackageDir,
|
|
77
77
|
enabled: true,
|
|
78
78
|
appType: this.appType
|
|
79
79
|
});
|
|
80
|
-
|
|
80
|
+
_chunkQZJTOS3Ujs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
81
81
|
}
|
|
82
82
|
if (disabledOptions.plugin) {
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
const patchRecorderState =
|
|
85
|
+
const patchRecorderState = _chunkIGTIMGCPjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
86
86
|
source: "runtime",
|
|
87
87
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
88
88
|
});
|
|
@@ -93,12 +93,12 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
93
93
|
onPatchCompleted: patchRecorderState.onPatchCompleted
|
|
94
94
|
};
|
|
95
95
|
const refreshRuntimeState = async (force) => {
|
|
96
|
-
await
|
|
96
|
+
await _chunkA2OSQ5CVjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
97
97
|
};
|
|
98
98
|
async function getClassSetInLoader() {
|
|
99
99
|
await refreshRuntimeState(true);
|
|
100
100
|
await runtimeState.patchPromise;
|
|
101
|
-
await
|
|
101
|
+
await _chunkA2OSQ5CVjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
102
102
|
}
|
|
103
103
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
104
104
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -111,16 +111,16 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
111
111
|
const classSetLoaderOptions = {
|
|
112
112
|
getClassSet: getClassSetInLoader
|
|
113
113
|
};
|
|
114
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
114
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunkQZJTOS3Ujs.createLoaderAnchorFinders.call(void 0, this.appType);
|
|
115
115
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
116
116
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
117
117
|
} : void 0;
|
|
118
118
|
onLoad();
|
|
119
119
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
120
|
-
|
|
120
|
+
_chunkQZJTOS3Ujs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir);
|
|
121
121
|
}
|
|
122
122
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
123
|
-
|
|
123
|
+
_chunkQZJTOS3Ujs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
124
124
|
}
|
|
125
125
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
126
126
|
loader: runtimeClassSetLoader,
|
|
@@ -139,19 +139,19 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
139
139
|
type: null
|
|
140
140
|
};
|
|
141
141
|
};
|
|
142
|
-
compiler.hooks.compilation.tap(
|
|
143
|
-
compilation.hooks.normalModuleLoader.tap(
|
|
142
|
+
compiler.hooks.compilation.tap(_chunkA2OSQ5CVjs.pluginName, (compilation) => {
|
|
143
|
+
compilation.hooks.normalModuleLoader.tap(_chunkA2OSQ5CVjs.pluginName, (_loaderContext, module) => {
|
|
144
144
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
145
145
|
if (!hasRuntimeLoader) {
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
|
-
if (shouldRewriteCssImports &&
|
|
149
|
-
|
|
148
|
+
if (shouldRewriteCssImports && _chunkQZJTOS3Ujs.isMpx.call(void 0, this.appType) && typeof _loaderContext.resolve === "function") {
|
|
149
|
+
_chunkQZJTOS3Ujs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir, true);
|
|
150
150
|
}
|
|
151
151
|
const loaderEntries = module.loaders || [];
|
|
152
152
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
153
153
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
154
|
-
const isCssModule =
|
|
154
|
+
const isCssModule = _chunkQZJTOS3Ujs.isCssLikeModuleResource.call(void 0, module.resource, this.options.cssMatcher, this.appType);
|
|
155
155
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
156
156
|
debug("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
157
157
|
}
|
|
@@ -185,7 +185,7 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
185
185
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
if (runtimeClassSetLoaderExists && !
|
|
188
|
+
if (runtimeClassSetLoaderExists && !_chunkQZJTOS3Ujs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
189
189
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
190
190
|
if (anchorIndex === -1) {
|
|
191
191
|
anchorlessInsert(createRuntimeClassSetLoaderEntry(), "before");
|
|
@@ -196,7 +196,7 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
196
196
|
}
|
|
197
197
|
});
|
|
198
198
|
});
|
|
199
|
-
compiler.hooks.emit.tapPromise(
|
|
199
|
+
compiler.hooks.emit.tapPromise(_chunkA2OSQ5CVjs.pluginName, async (compilation) => {
|
|
200
200
|
await runtimeState.patchPromise;
|
|
201
201
|
onStart();
|
|
202
202
|
debug("start");
|
|
@@ -262,7 +262,7 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
262
262
|
const groupedEntries = _chunkFMBPNII7js.getGroupedEntries.call(void 0, entries, this.options);
|
|
263
263
|
await refreshRuntimeState(true);
|
|
264
264
|
await runtimeState.patchPromise;
|
|
265
|
-
const runtimeSet = await
|
|
265
|
+
const runtimeSet = await _chunkA2OSQ5CVjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
266
266
|
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
267
267
|
const tasks = [];
|
|
268
268
|
if (Array.isArray(groupedEntries.html)) {
|
|
@@ -299,7 +299,7 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
299
299
|
const jsTaskFactories = [];
|
|
300
300
|
if (Array.isArray(groupedEntries.js)) {
|
|
301
301
|
for (const [file] of groupedEntries.js) {
|
|
302
|
-
const cacheKey =
|
|
302
|
+
const cacheKey = _chunkQZJTOS3Ujs.getCacheKey.call(void 0, file);
|
|
303
303
|
const assetSource = compilation.assets[file];
|
|
304
304
|
if (!assetSource) {
|
|
305
305
|
continue;
|
package/dist/webpack4.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
isMpx,
|
|
10
10
|
patchMpxLoaderResolve,
|
|
11
11
|
setupMpxTailwindcssRedirect
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QJTJC5UT.mjs";
|
|
13
13
|
import {
|
|
14
14
|
pushConcurrentTaskFactories,
|
|
15
15
|
resolveDisabledOptions,
|
|
@@ -22,14 +22,14 @@ import {
|
|
|
22
22
|
} from "./chunk-RRHPTTCP.mjs";
|
|
23
23
|
import {
|
|
24
24
|
setupPatchRecorder
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-GIUNRP65.mjs";
|
|
26
26
|
import {
|
|
27
27
|
collectRuntimeClassSet,
|
|
28
28
|
createDebug,
|
|
29
29
|
getCompilerContext,
|
|
30
30
|
pluginName,
|
|
31
31
|
refreshTailwindRuntimeState
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-4Z6MHSEO.mjs";
|
|
33
33
|
import "./chunk-SZOXLSNK.mjs";
|
|
34
34
|
import "./chunk-TFOTUR4L.mjs";
|
|
35
35
|
import {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
|
-
"version": "4.9.0
|
|
3
|
+
"version": "4.9.0",
|
|
4
4
|
"description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -184,9 +184,9 @@
|
|
|
184
184
|
"tailwindcss-patch": "^8.6.0",
|
|
185
185
|
"webpack-sources": "3.3.3",
|
|
186
186
|
"yaml": "^2.8.2",
|
|
187
|
-
"@weapp-tailwindcss/
|
|
187
|
+
"@weapp-tailwindcss/logger": "1.1.0",
|
|
188
188
|
"@weapp-tailwindcss/shared": "1.1.1",
|
|
189
|
-
"@weapp-tailwindcss/
|
|
189
|
+
"@weapp-tailwindcss/postcss": "2.1.0"
|
|
190
190
|
},
|
|
191
191
|
"scripts": {
|
|
192
192
|
"dev": "tsup --watch --sourcemap",
|