weapp-tailwindcss 4.9.2-alpha.2 → 4.9.2
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-JOLM54PI.mjs → chunk-2L6NDZIQ.mjs} +2 -2
- package/dist/{chunk-CF7VDUIE.mjs → chunk-5AKI6FQP.mjs} +3 -3
- package/dist/{chunk-QA5NZSGN.mjs → chunk-CBOVUIXD.mjs} +1 -1
- package/dist/{chunk-W4XFWZB5.js → chunk-DNRNFN4I.js} +3 -3
- package/dist/{chunk-6HBFEXOW.mjs → chunk-DSD5JRCQ.mjs} +2 -2
- package/dist/{chunk-XWGIWOHV.mjs → chunk-G5OV7IOU.mjs} +1 -1
- package/dist/{chunk-OGG7WXHZ.js → chunk-SNEMGP42.js} +22 -22
- package/dist/{chunk-NGRAUBWU.js → chunk-U7BH6QHE.js} +13 -13
- package/dist/{chunk-YBTRKOE2.js → chunk-VU2GIXVH.js} +7 -7
- package/dist/{chunk-KA2JONAP.js → chunk-W3MTTQ5M.js} +3 -3
- package/dist/{chunk-OU2OBBPZ.mjs → chunk-WGBJY2H3.mjs} +1 -1
- package/dist/{chunk-J7KULRTR.js → chunk-XXJNXESJ.js} +1 -1
- 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-G5OV7IOU.mjs";
|
|
7
7
|
import {
|
|
8
8
|
collectRuntimeClassSet,
|
|
9
9
|
createDebug,
|
|
10
10
|
getCompilerContext,
|
|
11
11
|
refreshTailwindRuntimeState
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WGBJY2H3.mjs";
|
|
13
13
|
|
|
14
14
|
// src/bundlers/gulp/index.ts
|
|
15
15
|
import { Buffer } from "buffer";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
isMpx,
|
|
10
10
|
patchMpxLoaderResolve,
|
|
11
11
|
setupMpxTailwindcssRedirect
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CBOVUIXD.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-G5OV7IOU.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-WGBJY2H3.mjs";
|
|
33
33
|
import {
|
|
34
34
|
getGroupedEntries
|
|
35
35
|
} from "./chunk-OOHJLO5M.mjs";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunk2WPTDMN3js = require('./chunk-2WPTDMN3.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkXXJNXESJjs = require('./chunk-XXJNXESJ.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(_chunkXXJNXESJjs.pluginName, (factory) => {
|
|
158
|
+
factory.hooks.beforeResolve.tap(_chunkXXJNXESJjs.pluginName, (data) => {
|
|
159
159
|
rewriteTailwindcssRequestForCss(data, options.pkgDir, options.appType);
|
|
160
160
|
});
|
|
161
161
|
});
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-RRHPTTCP.mjs";
|
|
13
13
|
import {
|
|
14
14
|
setupPatchRecorder
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-G5OV7IOU.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-WGBJY2H3.mjs";
|
|
27
27
|
import {
|
|
28
28
|
getGroupedEntries,
|
|
29
29
|
resolveUniUtsPlatform
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkDNRNFN4Ijs = require('./chunk-DNRNFN4I.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -22,14 +22,14 @@ var _chunk2WPTDMN3js = require('./chunk-2WPTDMN3.js');
|
|
|
22
22
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunkW3MTTQ5Mjs = require('./chunk-W3MTTQ5M.js');
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkXXJNXESJjs = require('./chunk-XXJNXESJ.js');
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
@@ -38,11 +38,11 @@ var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.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 = _chunkXXJNXESJjs.createDebug.call(void 0, );
|
|
42
42
|
var weappTailwindcssPackageDir = _chunk2WPTDMN3js.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
43
43
|
var UnifiedWebpackPluginV5 = class {
|
|
44
44
|
constructor(options = {}) {
|
|
45
|
-
this.options =
|
|
45
|
+
this.options = _chunkXXJNXESJjs.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 = _chunk2WPTDMN3js.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 = _chunkDNRNFN4Ijs.isMpx.call(void 0, this.appType);
|
|
70
70
|
if (shouldRewriteCssImports) {
|
|
71
|
-
|
|
71
|
+
_chunkDNRNFN4Ijs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
72
72
|
pkgDir: weappTailwindcssPackageDir,
|
|
73
73
|
enabled: true,
|
|
74
74
|
appType: this.appType
|
|
75
75
|
});
|
|
76
|
-
|
|
76
|
+
_chunkDNRNFN4Ijs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
77
77
|
}
|
|
78
78
|
if (disabledOptions.plugin) {
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
const patchRecorderState =
|
|
81
|
+
const patchRecorderState = _chunkW3MTTQ5Mjs.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 _chunkXXJNXESJjs.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 _chunkXXJNXESJjs.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 } = _chunkDNRNFN4Ijs.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
|
+
_chunkDNRNFN4Ijs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir);
|
|
119
119
|
}
|
|
120
120
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
121
|
-
|
|
121
|
+
_chunkDNRNFN4Ijs.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(_chunkXXJNXESJjs.pluginName, (compilation) => {
|
|
141
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(_chunkXXJNXESJjs.pluginName, (_loaderContext, module) => {
|
|
142
142
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
143
143
|
if (!hasRuntimeLoader) {
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
146
|
-
|
|
146
|
+
_chunkDNRNFN4Ijs.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 = _chunkDNRNFN4Ijs.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 && !_chunkDNRNFN4Ijs.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: _chunkXXJNXESJjs.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 = _chunkDYLQ6UOIjs.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 _chunkXXJNXESJjs.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 = _chunkDNRNFN4Ijs.getCacheKey.call(void 0, file);
|
|
302
302
|
const asset = compilation.getAsset(file);
|
|
303
303
|
if (!asset) {
|
|
304
304
|
continue;
|
|
@@ -12,7 +12,7 @@ var _chunk2WPTDMN3js = require('./chunk-2WPTDMN3.js');
|
|
|
12
12
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkW3MTTQ5Mjs = require('./chunk-W3MTTQ5M.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -23,7 +23,7 @@ var _chunkKA2JONAPjs = require('./chunk-KA2JONAP.js');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkXXJNXESJjs = require('./chunk-XXJNXESJ.js');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
@@ -56,7 +56,7 @@ function updateStaticAttribute(ms, prop) {
|
|
|
56
56
|
const start = prop.value.loc.start.offset + 1;
|
|
57
57
|
const end = prop.value.loc.end.offset - 1;
|
|
58
58
|
if (start < end) {
|
|
59
|
-
ms.update(start, end,
|
|
59
|
+
ms.update(start, end, _chunkXXJNXESJjs.replaceWxml.call(void 0, prop.value.content));
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
@@ -68,7 +68,7 @@ function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
|
68
68
|
if (start >= end) {
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
const generated =
|
|
71
|
+
const generated = _chunkXXJNXESJjs.generateCode.call(void 0, prop.exp.content, {
|
|
72
72
|
jsHandler,
|
|
73
73
|
runtimeSet,
|
|
74
74
|
wrapExpression: true
|
|
@@ -97,7 +97,7 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
99
|
const { customAttributesEntities, disabledDefaultTemplateHandler = false } = options;
|
|
100
|
-
const matchCustomAttribute =
|
|
100
|
+
const matchCustomAttribute = _chunkXXJNXESJjs.createAttributeMatcher.call(void 0, customAttributesEntities);
|
|
101
101
|
const ms = new (0, _magicstring2.default)(code);
|
|
102
102
|
const { descriptor, errors } = _compilersfc.parse.call(void 0, code);
|
|
103
103
|
if (errors.length === 0) {
|
|
@@ -399,7 +399,7 @@ function createUniAppXAssetTask(file, originalSource, outDir, options) {
|
|
|
399
399
|
}
|
|
400
400
|
|
|
401
401
|
// src/bundlers/vite/index.ts
|
|
402
|
-
var debug =
|
|
402
|
+
var debug = _chunkXXJNXESJjs.createDebug.call(void 0, );
|
|
403
403
|
var weappTailwindcssPackageDir = _chunk2WPTDMN3js.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
404
404
|
var weappTailwindcssDirPosix = slash(weappTailwindcssPackageDir);
|
|
405
405
|
function joinPosixPath(base, subpath) {
|
|
@@ -482,7 +482,7 @@ function applyLinkedResults(linked, entries, onLinkedUpdate, onApplied) {
|
|
|
482
482
|
}
|
|
483
483
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
484
484
|
const rewriteCssImportsSpecified = Object.prototype.hasOwnProperty.call(options, "rewriteCssImports");
|
|
485
|
-
const opts =
|
|
485
|
+
const opts = _chunkXXJNXESJjs.getCompilerContext.call(void 0, options);
|
|
486
486
|
const {
|
|
487
487
|
disabled,
|
|
488
488
|
customAttributes,
|
|
@@ -506,7 +506,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
506
506
|
const shouldRewriteCssImports = opts.rewriteCssImports !== false && !disabledOptions.rewriteCssImports && (rewriteCssImportsSpecified || tailwindcssMajorVersion >= 4);
|
|
507
507
|
const rewritePlugins = !shouldRewriteCssImports ? [] : [
|
|
508
508
|
{
|
|
509
|
-
name: `${
|
|
509
|
+
name: `${_chunkXXJNXESJjs.vitePluginName}:rewrite-css-imports`,
|
|
510
510
|
enforce: "pre",
|
|
511
511
|
resolveId: {
|
|
512
512
|
order: "pre",
|
|
@@ -548,8 +548,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
548
548
|
if (disabledOptions.plugin) {
|
|
549
549
|
return rewritePlugins.length ? rewritePlugins : void 0;
|
|
550
550
|
}
|
|
551
|
-
const customAttributesEntities =
|
|
552
|
-
const patchRecorderState =
|
|
551
|
+
const customAttributesEntities = _chunkXXJNXESJjs.toCustomAttributesEntities.call(void 0, customAttributes);
|
|
552
|
+
const patchRecorderState = _chunkW3MTTQ5Mjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
553
553
|
source: "runtime",
|
|
554
554
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
555
555
|
});
|
|
@@ -563,7 +563,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
563
563
|
let runtimeSetPromise;
|
|
564
564
|
let resolvedConfig;
|
|
565
565
|
async function refreshRuntimeState(force) {
|
|
566
|
-
const refreshed = await
|
|
566
|
+
const refreshed = await _chunkXXJNXESJjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
567
567
|
if (refreshed) {
|
|
568
568
|
runtimeSet = void 0;
|
|
569
569
|
runtimeSetPromise = void 0;
|
|
@@ -576,7 +576,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
576
576
|
return runtimeSet;
|
|
577
577
|
}
|
|
578
578
|
if (force || !runtimeSetPromise) {
|
|
579
|
-
const task2 =
|
|
579
|
+
const task2 = _chunkXXJNXESJjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
|
|
580
580
|
force: force || !runtimeSet,
|
|
581
581
|
skipRefresh: force
|
|
582
582
|
});
|
|
@@ -611,7 +611,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
611
611
|
const plugins = [
|
|
612
612
|
...rewritePlugins,
|
|
613
613
|
{
|
|
614
|
-
name: `${
|
|
614
|
+
name: `${_chunkXXJNXESJjs.vitePluginName}:post`,
|
|
615
615
|
enforce: "post",
|
|
616
616
|
configResolved(config) {
|
|
617
617
|
resolvedConfig = config;
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkW3MTTQ5Mjs = require('./chunk-W3MTTQ5M.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkXXJNXESJjs = require('./chunk-XXJNXESJ.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 = _chunkXXJNXESJjs.createDebug.call(void 0, );
|
|
21
21
|
var Transform = _stream2.default.Transform;
|
|
22
22
|
function createPlugins(options = {}) {
|
|
23
|
-
const opts =
|
|
23
|
+
const opts = _chunkXXJNXESJjs.getCompilerContext.call(void 0, options);
|
|
24
24
|
const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
25
|
-
const patchRecorderState =
|
|
25
|
+
const patchRecorderState = _chunkW3MTTQ5Mjs.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 _chunkXXJNXESJjs.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 _chunkXXJNXESJjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force, skipRefresh: force });
|
|
48
48
|
runtimeSetInitialized = true;
|
|
49
49
|
return runtimeSet;
|
|
50
50
|
}
|
|
@@ -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 _chunkXXJNXESJjs = require('./chunk-XXJNXESJ.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunk5O6237HXjs = require('./chunk-5O6237HX.js');
|
|
8
8
|
|
|
9
9
|
// src/tailwindcss/recorder.ts
|
|
10
10
|
function setupPatchRecorder(patcher, baseDir, options) {
|
|
11
|
-
const recorder =
|
|
11
|
+
const recorder = _chunkXXJNXESJjs.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
|
_chunk5O6237HXjs.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 ? _chunkXXJNXESJjs.createTailwindPatchPromise.call(void 0, patcher, onPatchCompleted) : Promise.resolve();
|
|
20
20
|
return {
|
|
21
21
|
recorder,
|
|
22
22
|
patchPromise,
|
|
@@ -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.2
|
|
190
|
+
version: "4.9.2",
|
|
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",
|
|
@@ -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.2
|
|
190
|
+
version: "4.9.2",
|
|
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",
|
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkXXJNXESJjs = require('./chunk-XXJNXESJ.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 _chunkXXJNXESJjs.clearTailwindcssPatcherCache.call(void 0, patcher, { removeDirectory: true });
|
|
338
338
|
}
|
|
339
|
-
const recorder =
|
|
339
|
+
const recorder = _chunkXXJNXESJjs.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
|
_chunk5O6237HXjs.logger.info("[workspace] %s %s", displayName, recorder.message);
|
|
347
347
|
}
|
|
348
|
-
|
|
348
|
+
_chunkXXJNXESJjs.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 _chunkXXJNXESJjs.clearTailwindcssPatcherCache.call(void 0, patcher, { removeDirectory: true });
|
|
504
504
|
}
|
|
505
|
-
const recorder =
|
|
505
|
+
const recorder = _chunkXXJNXESJjs.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
|
_chunk5O6237HXjs.logger.info(recorder.message);
|
|
513
513
|
}
|
|
514
|
-
|
|
514
|
+
_chunkXXJNXESJjs.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, _chunkXXJNXESJjs.WEAPP_TW_REQUIRED_NODE_VERSION)) {
|
|
663
663
|
_chunk5O6237HXjs.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${_chunkXXJNXESJjs.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 _chunkW3MTTQ5Mjs = require('./chunk-W3MTTQ5M.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkXXJNXESJjs = require('./chunk-XXJNXESJ.js');
|
|
9
9
|
require('./chunk-5O6237HX.js');
|
|
10
10
|
require('./chunk-FYYBY3VK.js');
|
|
11
11
|
require('./chunk-DYLQ6UOI.js');
|
|
@@ -15,9 +15,9 @@ require('./chunk-UAEME5HT.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 = _chunkXXJNXESJjs.getCompilerContext.call(void 0, options);
|
|
19
19
|
const { templateHandler, styleHandler, jsHandler, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
20
|
-
const patchRecorderState =
|
|
20
|
+
const patchRecorderState = _chunkW3MTTQ5Mjs.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 _chunkXXJNXESJjs.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 _chunkXXJNXESJjs.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 _chunkXXJNXESJjs.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 _chunkXXJNXESJjs.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-G5OV7IOU.mjs";
|
|
4
4
|
import {
|
|
5
5
|
collectRuntimeClassSet,
|
|
6
6
|
getCompilerContext,
|
|
7
7
|
refreshTailwindRuntimeState
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WGBJY2H3.mjs";
|
|
9
9
|
import "./chunk-ZE7JKKFT.mjs";
|
|
10
10
|
import "./chunk-HWF5U4CI.mjs";
|
|
11
11
|
import "./chunk-OOHJLO5M.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 _chunkVU2GIXVHjs = require('./chunk-VU2GIXVH.js');
|
|
4
4
|
require('./chunk-LTJQUORK.js');
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-W3MTTQ5M.js');
|
|
6
|
+
require('./chunk-XXJNXESJ.js');
|
|
7
7
|
require('./chunk-5O6237HX.js');
|
|
8
8
|
require('./chunk-FYYBY3VK.js');
|
|
9
9
|
require('./chunk-DYLQ6UOI.js');
|
|
10
10
|
require('./chunk-UAEME5HT.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.createPlugins =
|
|
13
|
+
exports.createPlugins = _chunkVU2GIXVHjs.createPlugins;
|
package/dist/gulp.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPlugins
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2L6NDZIQ.mjs";
|
|
4
4
|
import "./chunk-RRHPTTCP.mjs";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-G5OV7IOU.mjs";
|
|
6
|
+
import "./chunk-WGBJY2H3.mjs";
|
|
7
7
|
import "./chunk-ZE7JKKFT.mjs";
|
|
8
8
|
import "./chunk-HWF5U4CI.mjs";
|
|
9
9
|
import "./chunk-OOHJLO5M.mjs";
|
package/dist/index.js
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('./chunk-
|
|
5
|
+
var _chunkSNEMGP42js = require('./chunk-SNEMGP42.js');
|
|
6
|
+
require('./chunk-DNRNFN4I.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkVU2GIXVHjs = require('./chunk-VU2GIXVH.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkU7BH6QHEjs = require('./chunk-U7BH6QHE.js');
|
|
13
13
|
require('./chunk-2WPTDMN3.js');
|
|
14
14
|
require('./chunk-LTJQUORK.js');
|
|
15
|
-
require('./chunk-
|
|
16
|
-
require('./chunk-
|
|
15
|
+
require('./chunk-W3MTTQ5M.js');
|
|
16
|
+
require('./chunk-XXJNXESJ.js');
|
|
17
17
|
require('./chunk-5O6237HX.js');
|
|
18
18
|
require('./chunk-FYYBY3VK.js');
|
|
19
19
|
require('./chunk-DYLQ6UOI.js');
|
|
@@ -23,4 +23,4 @@ require('./chunk-UAEME5HT.js');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
exports.UnifiedViteWeappTailwindcssPlugin =
|
|
26
|
+
exports.UnifiedViteWeappTailwindcssPlugin = _chunkU7BH6QHEjs.UnifiedViteWeappTailwindcssPlugin; exports.UnifiedWebpackPluginV5 = _chunkSNEMGP42js.UnifiedWebpackPluginV5; exports.createPlugins = _chunkVU2GIXVHjs.createPlugins; exports.weappTailwindcssPackageDir = _chunkSNEMGP42js.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-5AKI6FQP.mjs";
|
|
6
|
+
import "./chunk-CBOVUIXD.mjs";
|
|
7
7
|
import {
|
|
8
8
|
createPlugins
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-2L6NDZIQ.mjs";
|
|
10
10
|
import {
|
|
11
11
|
UnifiedViteWeappTailwindcssPlugin
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-DSD5JRCQ.mjs";
|
|
13
13
|
import "./chunk-3SKEY32E.mjs";
|
|
14
14
|
import "./chunk-RRHPTTCP.mjs";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-G5OV7IOU.mjs";
|
|
16
|
+
import "./chunk-WGBJY2H3.mjs";
|
|
17
17
|
import "./chunk-ZE7JKKFT.mjs";
|
|
18
18
|
import "./chunk-HWF5U4CI.mjs";
|
|
19
19
|
import "./chunk-OOHJLO5M.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 _chunkU7BH6QHEjs = require('./chunk-U7BH6QHE.js');
|
|
4
4
|
require('./chunk-2WPTDMN3.js');
|
|
5
5
|
require('./chunk-LTJQUORK.js');
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-W3MTTQ5M.js');
|
|
7
|
+
require('./chunk-XXJNXESJ.js');
|
|
8
8
|
require('./chunk-5O6237HX.js');
|
|
9
9
|
require('./chunk-FYYBY3VK.js');
|
|
10
10
|
require('./chunk-DYLQ6UOI.js');
|
|
11
11
|
require('./chunk-UAEME5HT.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.UnifiedViteWeappTailwindcssPlugin =
|
|
14
|
+
exports.UnifiedViteWeappTailwindcssPlugin = _chunkU7BH6QHEjs.UnifiedViteWeappTailwindcssPlugin;
|
package/dist/vite.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedViteWeappTailwindcssPlugin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DSD5JRCQ.mjs";
|
|
4
4
|
import "./chunk-3SKEY32E.mjs";
|
|
5
5
|
import "./chunk-RRHPTTCP.mjs";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-G5OV7IOU.mjs";
|
|
7
|
+
import "./chunk-WGBJY2H3.mjs";
|
|
8
8
|
import "./chunk-ZE7JKKFT.mjs";
|
|
9
9
|
import "./chunk-HWF5U4CI.mjs";
|
|
10
10
|
import "./chunk-OOHJLO5M.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 _chunkSNEMGP42js = require('./chunk-SNEMGP42.js');
|
|
5
|
+
require('./chunk-DNRNFN4I.js');
|
|
6
6
|
require('./chunk-2WPTDMN3.js');
|
|
7
7
|
require('./chunk-LTJQUORK.js');
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-W3MTTQ5M.js');
|
|
9
|
+
require('./chunk-XXJNXESJ.js');
|
|
10
10
|
require('./chunk-5O6237HX.js');
|
|
11
11
|
require('./chunk-FYYBY3VK.js');
|
|
12
12
|
require('./chunk-DYLQ6UOI.js');
|
|
@@ -14,4 +14,4 @@ require('./chunk-UAEME5HT.js');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.UnifiedWebpackPluginV5 =
|
|
17
|
+
exports.UnifiedWebpackPluginV5 = _chunkSNEMGP42js.UnifiedWebpackPluginV5; exports.weappTailwindcssPackageDir = _chunkSNEMGP42js.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-5AKI6FQP.mjs";
|
|
5
|
+
import "./chunk-CBOVUIXD.mjs";
|
|
6
6
|
import "./chunk-3SKEY32E.mjs";
|
|
7
7
|
import "./chunk-RRHPTTCP.mjs";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-G5OV7IOU.mjs";
|
|
9
|
+
import "./chunk-WGBJY2H3.mjs";
|
|
10
10
|
import "./chunk-ZE7JKKFT.mjs";
|
|
11
11
|
import "./chunk-HWF5U4CI.mjs";
|
|
12
12
|
import "./chunk-OOHJLO5M.mjs";
|
package/dist/webpack4.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkDNRNFN4Ijs = require('./chunk-DNRNFN4I.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -22,14 +22,14 @@ var _chunk2WPTDMN3js = require('./chunk-2WPTDMN3.js');
|
|
|
22
22
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunkW3MTTQ5Mjs = require('./chunk-W3MTTQ5M.js');
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkXXJNXESJjs = require('./chunk-XXJNXESJ.js');
|
|
33
33
|
require('./chunk-5O6237HX.js');
|
|
34
34
|
require('./chunk-FYYBY3VK.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 = _chunkXXJNXESJjs.createDebug.call(void 0, );
|
|
46
46
|
var weappTailwindcssPackageDir = _chunk2WPTDMN3js.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
47
47
|
var UnifiedWebpackPluginV4 = class {
|
|
48
48
|
constructor(options = {}) {
|
|
49
|
-
this.options =
|
|
49
|
+
this.options = _chunkXXJNXESJjs.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 = _chunk2WPTDMN3js.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 = _chunkDNRNFN4Ijs.isMpx.call(void 0, this.appType);
|
|
74
74
|
if (shouldRewriteCssImports) {
|
|
75
|
-
|
|
75
|
+
_chunkDNRNFN4Ijs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
76
76
|
pkgDir: weappTailwindcssPackageDir,
|
|
77
77
|
enabled: true,
|
|
78
78
|
appType: this.appType
|
|
79
79
|
});
|
|
80
|
-
|
|
80
|
+
_chunkDNRNFN4Ijs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
81
81
|
}
|
|
82
82
|
if (disabledOptions.plugin) {
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
const patchRecorderState =
|
|
85
|
+
const patchRecorderState = _chunkW3MTTQ5Mjs.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 _chunkXXJNXESJjs.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 _chunkXXJNXESJjs.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 } = _chunkDNRNFN4Ijs.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
|
+
_chunkDNRNFN4Ijs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir);
|
|
121
121
|
}
|
|
122
122
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
123
|
-
|
|
123
|
+
_chunkDNRNFN4Ijs.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(_chunkXXJNXESJjs.pluginName, (compilation) => {
|
|
143
|
+
compilation.hooks.normalModuleLoader.tap(_chunkXXJNXESJjs.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 && _chunkDNRNFN4Ijs.isMpx.call(void 0, this.appType) && typeof _loaderContext.resolve === "function") {
|
|
149
|
+
_chunkDNRNFN4Ijs.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 = _chunkDNRNFN4Ijs.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 && !_chunkDNRNFN4Ijs.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(_chunkXXJNXESJjs.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 = _chunkDYLQ6UOIjs.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 _chunkXXJNXESJjs.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 = _chunkDNRNFN4Ijs.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-CBOVUIXD.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-G5OV7IOU.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-WGBJY2H3.mjs";
|
|
33
33
|
import "./chunk-ZE7JKKFT.mjs";
|
|
34
34
|
import "./chunk-HWF5U4CI.mjs";
|
|
35
35
|
import {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
|
-
"version": "4.9.2
|
|
3
|
+
"version": "4.9.2",
|
|
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.1",
|
|
185
185
|
"webpack-sources": "3.3.3",
|
|
186
186
|
"yaml": "^2.8.2",
|
|
187
|
+
"@weapp-tailwindcss/logger": "1.1.0",
|
|
187
188
|
"@weapp-tailwindcss/postcss": "2.1.0",
|
|
188
|
-
"@weapp-tailwindcss/shared": "1.1.1"
|
|
189
|
-
"@weapp-tailwindcss/logger": "1.1.0"
|
|
189
|
+
"@weapp-tailwindcss/shared": "1.1.1"
|
|
190
190
|
},
|
|
191
191
|
"scripts": {
|
|
192
192
|
"dev": "tsup --watch --sourcemap",
|