weapp-tailwindcss 4.11.0-alpha.7 → 4.11.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-YHOO6IYY.js → chunk-2PXISDSY.js} +28 -28
- package/dist/{chunk-FOPUGLMU.js → chunk-C4CWDYUP.js} +6 -6
- package/dist/{chunk-LGNJJ4IX.mjs → chunk-FTFADUJ4.mjs} +1 -1
- package/dist/{chunk-MWD6KXCM.js → chunk-GVYD6TY7.js} +25 -25
- package/dist/{chunk-LNPPN5O3.mjs → chunk-KWSWZP5H.mjs} +1 -1
- package/dist/{chunk-FQIH7AH7.mjs → chunk-MAIS4SDW.mjs} +1 -1
- package/dist/{chunk-SHNOIM23.mjs → chunk-UO725AHQ.mjs} +1 -1
- package/dist/{chunk-Q7RLNWRZ.mjs → chunk-Y75XZ6KA.mjs} +2 -2
- package/dist/{chunk-6HIFX7CP.js → chunk-Z6RS5OPN.js} +1 -1
- package/dist/{chunk-2HC6PS4O.js → chunk-ZQAWDXIW.js} +3 -3
- package/dist/cli.js +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/core.js +6 -6
- package/dist/core.mjs +1 -1
- package/dist/gulp.js +3 -3
- package/dist/gulp.mjs +2 -2
- package/dist/index.js +6 -6
- package/dist/index.mjs +5 -5
- package/dist/vite.js +3 -3
- package/dist/vite.mjs +2 -2
- package/dist/webpack.js +4 -4
- package/dist/webpack.mjs +3 -3
- package/dist/webpack4.js +24 -24
- package/dist/webpack4.mjs +2 -2
- package/package.json +3 -3
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkZQAWDXIWjs = require('./chunk-ZQAWDXIW.js');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
@@ -28,7 +28,7 @@ var _chunkOF6MFURRjs = require('./chunk-OF6MFURR.js');
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
var
|
|
31
|
+
var _chunkZ6RS5OPNjs = require('./chunk-Z6RS5OPN.js');
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
@@ -63,10 +63,10 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
63
63
|
const { Compilation, sources } = compiler.webpack;
|
|
64
64
|
const { ConcatSource } = sources;
|
|
65
65
|
const cssHandlerOptionsCache = /* @__PURE__ */ new Map();
|
|
66
|
-
compiler.hooks.compilation.tap(
|
|
66
|
+
compiler.hooks.compilation.tap(_chunkZ6RS5OPNjs.pluginName, (compilation) => {
|
|
67
67
|
compilation.hooks.processAssets.tapPromise(
|
|
68
68
|
{
|
|
69
|
-
name:
|
|
69
|
+
name: _chunkZ6RS5OPNjs.pluginName,
|
|
70
70
|
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
71
71
|
},
|
|
72
72
|
async (assets) => {
|
|
@@ -78,7 +78,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
78
78
|
compilerOptions.cache.calcHashValueChanged(chunk.id, chunk.hash);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
const assetHashByChunk =
|
|
81
|
+
const assetHashByChunk = _chunkZQAWDXIWjs.createAssetHashByChunkMap.call(void 0, compilation.chunks);
|
|
82
82
|
const entries = Object.entries(assets);
|
|
83
83
|
const compilerOutputPath = _nullishCoalesce(_optionalChain([compilation, 'access', _ => _.compiler, 'optionalAccess', _2 => _2.outputPath]), () => ( compiler.outputPath));
|
|
84
84
|
const outputDir = compilerOutputPath ? _path2.default.resolve(compilerOutputPath) : _nullishCoalesce(_optionalChain([compilation, 'access', _3 => _3.outputOptions, 'optionalAccess', _4 => _4.path]), () => ( _process2.default.cwd()));
|
|
@@ -157,7 +157,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
157
157
|
const staleClassNameFallback = resolveWebpackStaleClassNameFallback(compilerOptions.staleClassNameFallback, compiler);
|
|
158
158
|
const forceRuntimeRefresh = getRuntimeRefreshRequirement();
|
|
159
159
|
debug2("processAssets ensure runtime set forceRefresh=%s major=%s", forceRuntimeRefresh, _nullishCoalesce(runtimeState.twPatcher.majorVersion, () => ( "unknown")));
|
|
160
|
-
const runtimeSet = await
|
|
160
|
+
const runtimeSet = await _chunkZ6RS5OPNjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
161
161
|
forceRefresh: forceRuntimeRefresh,
|
|
162
162
|
// webpack 的 script-only 热更新可能不会触发 runtime classset loader,
|
|
163
163
|
// 这里强制收集可避免沿用上轮 class set,保证 JS 仅按最新集合精确命中。
|
|
@@ -207,7 +207,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
207
207
|
const jsTaskFactories = [];
|
|
208
208
|
if (Array.isArray(groupedEntries.js)) {
|
|
209
209
|
for (const [file] of groupedEntries.js) {
|
|
210
|
-
const cacheKey =
|
|
210
|
+
const cacheKey = _chunkZQAWDXIWjs.getCacheKey.call(void 0, file);
|
|
211
211
|
const asset = compilation.getAsset(file);
|
|
212
212
|
if (!asset) {
|
|
213
213
|
continue;
|
|
@@ -313,9 +313,9 @@ function setupWebpackV5Loaders(options) {
|
|
|
313
313
|
getRuntimeWatchDependencies,
|
|
314
314
|
debug: debug2
|
|
315
315
|
} = options;
|
|
316
|
-
const isMpxApp =
|
|
316
|
+
const isMpxApp = _chunkZQAWDXIWjs.isMpx.call(void 0, appType);
|
|
317
317
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
318
|
-
|
|
318
|
+
_chunkZQAWDXIWjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
|
|
319
319
|
}
|
|
320
320
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
321
321
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -329,12 +329,12 @@ function setupWebpackV5Loaders(options) {
|
|
|
329
329
|
getClassSet: getClassSetInLoader,
|
|
330
330
|
getWatchDependencies: getRuntimeWatchDependencies
|
|
331
331
|
};
|
|
332
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
332
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunkZQAWDXIWjs.createLoaderAnchorFinders.call(void 0, appType);
|
|
333
333
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
334
334
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
335
335
|
} : void 0;
|
|
336
336
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
337
|
-
|
|
337
|
+
_chunkZQAWDXIWjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
338
338
|
}
|
|
339
339
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
340
340
|
loader: runtimeClassSetLoader,
|
|
@@ -354,17 +354,17 @@ function setupWebpackV5Loaders(options) {
|
|
|
354
354
|
};
|
|
355
355
|
};
|
|
356
356
|
const { NormalModule } = compiler.webpack;
|
|
357
|
-
compiler.hooks.compilation.tap(
|
|
358
|
-
NormalModule.getCompilationHooks(compilation).loader.tap(
|
|
357
|
+
compiler.hooks.compilation.tap(_chunkZ6RS5OPNjs.pluginName, (compilation) => {
|
|
358
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(_chunkZ6RS5OPNjs.pluginName, (_loaderContext, module) => {
|
|
359
359
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
360
360
|
if (!hasRuntimeLoader) {
|
|
361
361
|
return;
|
|
362
362
|
}
|
|
363
|
-
|
|
363
|
+
_chunkZQAWDXIWjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, shouldRewriteCssImports && isMpxApp);
|
|
364
364
|
const loaderEntries = module.loaders || [];
|
|
365
365
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
366
366
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
367
|
-
const isCssModule =
|
|
367
|
+
const isCssModule = _chunkZQAWDXIWjs.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
|
|
368
368
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
369
369
|
debug2("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
370
370
|
}
|
|
@@ -396,7 +396,7 @@ function setupWebpackV5Loaders(options) {
|
|
|
396
396
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
|
-
if (runtimeClassSetLoaderExists && !
|
|
399
|
+
if (runtimeClassSetLoaderExists && !_chunkZQAWDXIWjs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
400
400
|
const classSetLoaderEntry = createRuntimeClassSetLoaderEntry();
|
|
401
401
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
402
402
|
if (anchorIndex === -1) {
|
|
@@ -411,11 +411,11 @@ function setupWebpackV5Loaders(options) {
|
|
|
411
411
|
}
|
|
412
412
|
|
|
413
413
|
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
414
|
-
var debug =
|
|
414
|
+
var debug = _chunkZ6RS5OPNjs.createDebug.call(void 0, );
|
|
415
415
|
var weappTailwindcssPackageDir = _chunk7LKMJZD2js.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
416
416
|
var UnifiedWebpackPluginV5 = class {
|
|
417
417
|
constructor(options = {}) {
|
|
418
|
-
this.options =
|
|
418
|
+
this.options = _chunkZ6RS5OPNjs.getCompilerContext.call(void 0, options);
|
|
419
419
|
this.appType = this.options.appType;
|
|
420
420
|
}
|
|
421
421
|
apply(compiler) {
|
|
@@ -431,19 +431,19 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
431
431
|
const disabledOptions = _chunk7LKMJZD2js.resolveDisabledOptions.call(void 0, disabled);
|
|
432
432
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
433
433
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
434
|
-
const isMpxApp =
|
|
434
|
+
const isMpxApp = _chunkZQAWDXIWjs.isMpx.call(void 0, this.appType);
|
|
435
435
|
if (shouldRewriteCssImports) {
|
|
436
|
-
|
|
436
|
+
_chunkZQAWDXIWjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
437
437
|
pkgDir: weappTailwindcssPackageDir,
|
|
438
438
|
enabled: true,
|
|
439
439
|
appType: this.appType
|
|
440
440
|
});
|
|
441
|
-
|
|
441
|
+
_chunkZQAWDXIWjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
442
442
|
}
|
|
443
443
|
if (disabledOptions.plugin) {
|
|
444
444
|
return;
|
|
445
445
|
}
|
|
446
|
-
const patchRecorderState =
|
|
446
|
+
const patchRecorderState = _chunkZ6RS5OPNjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
447
447
|
source: "runtime",
|
|
448
448
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
449
449
|
});
|
|
@@ -501,21 +501,21 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
501
501
|
runtimeMetadataPrepared = true;
|
|
502
502
|
};
|
|
503
503
|
const syncRuntimeRefreshRequirement = () => {
|
|
504
|
-
runtimeRefreshRequiredForCompilation = runtimeRefreshRequiredForCompilation ||
|
|
504
|
+
runtimeRefreshRequiredForCompilation = runtimeRefreshRequiredForCompilation || _chunkZQAWDXIWjs.hasWatchChanges.call(void 0, compiler);
|
|
505
505
|
};
|
|
506
506
|
const resetRuntimePreparation = () => {
|
|
507
507
|
runtimeSetPrepared = false;
|
|
508
508
|
runtimeMetadataPrepared = false;
|
|
509
509
|
syncRuntimeRefreshRequirement();
|
|
510
510
|
};
|
|
511
|
-
_optionalChain([compiler, 'access', _20 => _20.hooks, 'access', _21 => _21.invalid, 'optionalAccess', _22 => _22.tap, 'optionalCall', _23 => _23(
|
|
511
|
+
_optionalChain([compiler, 'access', _20 => _20.hooks, 'access', _21 => _21.invalid, 'optionalAccess', _22 => _22.tap, 'optionalCall', _23 => _23(_chunkZ6RS5OPNjs.pluginName, () => {
|
|
512
512
|
runtimeRefreshRequiredForCompilation = true;
|
|
513
513
|
})]);
|
|
514
|
-
_optionalChain([compiler, 'access', _24 => _24.hooks, 'access', _25 => _25.watchRun, 'optionalAccess', _26 => _26.tap, 'optionalCall', _27 => _27(
|
|
514
|
+
_optionalChain([compiler, 'access', _24 => _24.hooks, 'access', _25 => _25.watchRun, 'optionalAccess', _26 => _26.tap, 'optionalCall', _27 => _27(_chunkZ6RS5OPNjs.pluginName, syncRuntimeRefreshRequirement)]);
|
|
515
515
|
if (_optionalChain([compiler, 'access', _28 => _28.hooks, 'access', _29 => _29.thisCompilation, 'optionalAccess', _30 => _30.tap])) {
|
|
516
|
-
compiler.hooks.thisCompilation.tap(
|
|
516
|
+
compiler.hooks.thisCompilation.tap(_chunkZ6RS5OPNjs.pluginName, resetRuntimePreparation);
|
|
517
517
|
} else if (_optionalChain([compiler, 'access', _31 => _31.hooks, 'access', _32 => _32.compilation, 'optionalAccess', _33 => _33.tap])) {
|
|
518
|
-
compiler.hooks.compilation.tap(
|
|
518
|
+
compiler.hooks.compilation.tap(_chunkZ6RS5OPNjs.pluginName, resetRuntimePreparation);
|
|
519
519
|
}
|
|
520
520
|
async function getClassSetInLoader() {
|
|
521
521
|
if (runtimeSetPrepared) {
|
|
@@ -525,7 +525,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
525
525
|
const forceRefresh = runtimeRefreshRequiredForCompilation || signature !== runtimeSetSignature;
|
|
526
526
|
debug("runtime loader ensure class set forceRefresh=%s watchDirty=%s signatureChanged=%s", forceRefresh, runtimeRefreshRequiredForCompilation, signature !== runtimeSetSignature);
|
|
527
527
|
runtimeSetPrepared = true;
|
|
528
|
-
await
|
|
528
|
+
await _chunkZ6RS5OPNjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
529
529
|
forceRefresh,
|
|
530
530
|
forceCollect: true,
|
|
531
531
|
clearCache: forceRefresh,
|
|
@@ -7,7 +7,7 @@ var _chunkOF6MFURRjs = require('./chunk-OF6MFURR.js');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkZ6RS5OPNjs = require('./chunk-Z6RS5OPN.js');
|
|
11
11
|
|
|
12
12
|
// src/bundlers/gulp/index.ts
|
|
13
13
|
var _buffer = require('buffer');
|
|
@@ -15,12 +15,12 @@ var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
|
15
15
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
16
16
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
17
17
|
var _stream = require('stream'); var _stream2 = _interopRequireDefault(_stream);
|
|
18
|
-
var debug =
|
|
18
|
+
var debug = _chunkZ6RS5OPNjs.createDebug.call(void 0, );
|
|
19
19
|
var Transform = _stream2.default.Transform;
|
|
20
20
|
function createPlugins(options = {}) {
|
|
21
|
-
const opts =
|
|
21
|
+
const opts = _chunkZ6RS5OPNjs.getCompilerContext.call(void 0, options);
|
|
22
22
|
const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
23
|
-
const patchRecorderState =
|
|
23
|
+
const patchRecorderState = _chunkZ6RS5OPNjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
24
24
|
source: "runtime",
|
|
25
25
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
26
26
|
});
|
|
@@ -38,13 +38,13 @@ function createPlugins(options = {}) {
|
|
|
38
38
|
const MODULE_EXTENSIONS = [".js", ".mjs", ".cjs", ".ts", ".tsx", ".jsx"];
|
|
39
39
|
let runtimeSetInitialized = false;
|
|
40
40
|
async function refreshRuntimeState(force) {
|
|
41
|
-
await
|
|
41
|
+
await _chunkZ6RS5OPNjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
42
42
|
}
|
|
43
43
|
async function refreshRuntimeSet(force = false) {
|
|
44
44
|
if (!force && runtimeSetInitialized) {
|
|
45
45
|
return runtimeSet;
|
|
46
46
|
}
|
|
47
|
-
runtimeSet = await
|
|
47
|
+
runtimeSet = await _chunkZ6RS5OPNjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
48
48
|
forceRefresh: force,
|
|
49
49
|
forceCollect: force,
|
|
50
50
|
clearCache: force,
|
|
@@ -26,7 +26,7 @@ var _chunkOF6MFURRjs = require('./chunk-OF6MFURR.js');
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
var
|
|
29
|
+
var _chunkZ6RS5OPNjs = require('./chunk-Z6RS5OPN.js');
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
@@ -89,7 +89,7 @@ function isRuntimeCandidate(candidate, runtimeSet) {
|
|
|
89
89
|
if (!runtimeSet || runtimeSet.size === 0) {
|
|
90
90
|
return false;
|
|
91
91
|
}
|
|
92
|
-
return runtimeSet.has(candidate) || runtimeSet.has(
|
|
92
|
+
return runtimeSet.has(candidate) || runtimeSet.has(_chunkZ6RS5OPNjs.replaceWxml.call(void 0, candidate));
|
|
93
93
|
}
|
|
94
94
|
function shouldEnableComponentLocalStyle(id) {
|
|
95
95
|
return COMPONENT_RE.test(id);
|
|
@@ -109,7 +109,7 @@ var UniAppXComponentLocalStyleCollector = class {
|
|
|
109
109
|
const alias = createAlias(this.fileId, utility, this.aliasByUtility.size);
|
|
110
110
|
this.aliasByUtility.set(utility, alias);
|
|
111
111
|
this.aliasByLookup.set(utility, alias);
|
|
112
|
-
this.aliasByLookup.set(
|
|
112
|
+
this.aliasByLookup.set(_chunkZ6RS5OPNjs.replaceWxml.call(void 0, utility), alias);
|
|
113
113
|
return alias;
|
|
114
114
|
}
|
|
115
115
|
rewriteLiteral(literal, shouldInclude) {
|
|
@@ -132,15 +132,15 @@ var UniAppXComponentLocalStyleCollector = class {
|
|
|
132
132
|
collectRuntimeClasses(rawSource, options = {}) {
|
|
133
133
|
const wrapped = options.wrapExpression ? `${EXPRESSION_WRAPPER_PREFIX}${rawSource}${EXPRESSION_WRAPPER_SUFFIX}` : rawSource;
|
|
134
134
|
try {
|
|
135
|
-
const ast =
|
|
135
|
+
const ast = _chunkZ6RS5OPNjs.babelParse.call(void 0, wrapped, {
|
|
136
136
|
plugins: ["typescript"],
|
|
137
137
|
sourceType: options.wrapExpression ? "module" : "unambiguous"
|
|
138
138
|
});
|
|
139
|
-
const analysis =
|
|
139
|
+
const analysis = _chunkZ6RS5OPNjs.analyzeSource.call(void 0, ast, {}, void 0, false);
|
|
140
140
|
for (const path6 of analysis.targetPaths) {
|
|
141
141
|
const { literal, allowDoubleQuotes } = extractLiteralValue(path6);
|
|
142
142
|
const candidates = _extractors.splitCode.call(void 0, literal, allowDoubleQuotes);
|
|
143
|
-
const classContext = options.wrapExpression ||
|
|
143
|
+
const classContext = options.wrapExpression || _chunkZ6RS5OPNjs.isClassContextLiteralPath.call(void 0, path6);
|
|
144
144
|
for (const candidate of candidates) {
|
|
145
145
|
if (!candidate || !classContext && !isRuntimeCandidate(candidate, this.runtimeSet)) {
|
|
146
146
|
continue;
|
|
@@ -159,15 +159,15 @@ var UniAppXComponentLocalStyleCollector = class {
|
|
|
159
159
|
}
|
|
160
160
|
const wrapped = options.wrapExpression ? `${EXPRESSION_WRAPPER_PREFIX}${rawSource}${EXPRESSION_WRAPPER_SUFFIX}` : rawSource;
|
|
161
161
|
try {
|
|
162
|
-
const ast =
|
|
162
|
+
const ast = _chunkZ6RS5OPNjs.babelParse.call(void 0, wrapped, {
|
|
163
163
|
plugins: ["typescript"],
|
|
164
164
|
sourceType: options.wrapExpression ? "module" : "unambiguous"
|
|
165
165
|
});
|
|
166
|
-
const analysis =
|
|
166
|
+
const analysis = _chunkZ6RS5OPNjs.analyzeSource.call(void 0, ast, {}, void 0, false);
|
|
167
167
|
if (analysis.targetPaths.length === 0) {
|
|
168
168
|
return rawSource;
|
|
169
169
|
}
|
|
170
|
-
const updater = new (0,
|
|
170
|
+
const updater = new (0, _chunkZ6RS5OPNjs.JsTokenUpdater)();
|
|
171
171
|
for (const path6 of analysis.targetPaths) {
|
|
172
172
|
const { literal, allowDoubleQuotes, offset } = extractLiteralValue(path6);
|
|
173
173
|
const candidates = _extractors.splitCode.call(void 0, literal, allowDoubleQuotes);
|
|
@@ -248,7 +248,7 @@ function updateStaticAttribute(ms, prop) {
|
|
|
248
248
|
const start = prop.value.loc.start.offset + 1;
|
|
249
249
|
const end = prop.value.loc.end.offset - 1;
|
|
250
250
|
if (start < end) {
|
|
251
|
-
ms.update(start, end,
|
|
251
|
+
ms.update(start, end, _chunkZ6RS5OPNjs.replaceWxml.call(void 0, prop.value.content));
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
function updateStaticAttributeWithLocalStyle(ms, prop, collector) {
|
|
@@ -270,7 +270,7 @@ function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
|
270
270
|
if (start >= end) {
|
|
271
271
|
return;
|
|
272
272
|
}
|
|
273
|
-
const generated =
|
|
273
|
+
const generated = _chunkZ6RS5OPNjs.generateCode.call(void 0, prop.exp.content, {
|
|
274
274
|
jsHandler,
|
|
275
275
|
runtimeSet,
|
|
276
276
|
wrapExpression: true
|
|
@@ -289,7 +289,7 @@ function updateDirectiveExpressionWithLocalStyle(ms, prop, jsHandler, collector,
|
|
|
289
289
|
collector.collectRuntimeClasses(prop.exp.content, {
|
|
290
290
|
wrapExpression: true
|
|
291
291
|
});
|
|
292
|
-
const generated =
|
|
292
|
+
const generated = _chunkZ6RS5OPNjs.generateCode.call(void 0, prop.exp.content, {
|
|
293
293
|
jsHandler,
|
|
294
294
|
runtimeSet,
|
|
295
295
|
wrapExpression: true
|
|
@@ -319,7 +319,7 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
319
319
|
return;
|
|
320
320
|
}
|
|
321
321
|
const { customAttributesEntities, disabledDefaultTemplateHandler = false } = options;
|
|
322
|
-
const matchCustomAttribute =
|
|
322
|
+
const matchCustomAttribute = _chunkZ6RS5OPNjs.createAttributeMatcher.call(void 0, customAttributesEntities);
|
|
323
323
|
const ms = new (0, _magicstring2.default)(code);
|
|
324
324
|
const { descriptor, errors } = _compilersfc.parse.call(void 0, code);
|
|
325
325
|
const localStyleCollector = options.enableComponentLocalStyle && shouldEnableComponentLocalStyle(id) ? new UniAppXComponentLocalStyleCollector(id, runtimeSet) : void 0;
|
|
@@ -818,14 +818,14 @@ function createHtmlRuntimeAffectingSignature(source) {
|
|
|
818
818
|
}
|
|
819
819
|
function createJsRuntimeAffectingSignature(source) {
|
|
820
820
|
try {
|
|
821
|
-
const ast =
|
|
821
|
+
const ast = _chunkZ6RS5OPNjs.babelParse.call(void 0, source, {
|
|
822
822
|
cache: true,
|
|
823
823
|
cacheKey: "vite-runtime-affecting:unambiguous",
|
|
824
824
|
plugins: ["jsx", "typescript"],
|
|
825
825
|
sourceType: "unambiguous"
|
|
826
826
|
});
|
|
827
827
|
const parts = [];
|
|
828
|
-
|
|
828
|
+
_chunkZ6RS5OPNjs.traverse.call(void 0, ast, {
|
|
829
829
|
noScope: true,
|
|
830
830
|
StringLiteral(path6) {
|
|
831
831
|
parts.push(`s:${path6.node.value}`);
|
|
@@ -1607,7 +1607,7 @@ var _module = require('module');
|
|
|
1607
1607
|
|
|
1608
1608
|
|
|
1609
1609
|
var _tailwindcsspatch = require('tailwindcss-patch');
|
|
1610
|
-
var debug =
|
|
1610
|
+
var debug = _chunkZ6RS5OPNjs.createDebug.call(void 0, "[vite:runtime-set] ");
|
|
1611
1611
|
var require2 = _module.createRequire.call(void 0, _chunkCRDOWYG4js.importMetaUrl);
|
|
1612
1612
|
var EXTENSION_DOT_PREFIX_RE = /^\./;
|
|
1613
1613
|
var VALIDATION_FILE_NAME = "runtime-candidates.html";
|
|
@@ -1978,7 +1978,7 @@ function createRewriteCssImportsPlugins(options) {
|
|
|
1978
1978
|
const { appType, weappTailwindcssDirPosix: weappTailwindcssDirPosix2 } = options;
|
|
1979
1979
|
return [
|
|
1980
1980
|
{
|
|
1981
|
-
name: `${
|
|
1981
|
+
name: `${_chunkZ6RS5OPNjs.vitePluginName}:rewrite-css-imports`,
|
|
1982
1982
|
enforce: "pre",
|
|
1983
1983
|
resolveId: {
|
|
1984
1984
|
order: "pre",
|
|
@@ -2020,7 +2020,7 @@ function createRewriteCssImportsPlugins(options) {
|
|
|
2020
2020
|
}
|
|
2021
2021
|
|
|
2022
2022
|
// src/bundlers/vite/index.ts
|
|
2023
|
-
var debug2 =
|
|
2023
|
+
var debug2 = _chunkZ6RS5OPNjs.createDebug.call(void 0, );
|
|
2024
2024
|
var weappTailwindcssPackageDir = _chunk7LKMJZD2js.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
2025
2025
|
var weappTailwindcssDirPosix = slash(weappTailwindcssPackageDir);
|
|
2026
2026
|
var PACKAGE_JSON_FILE = "package.json";
|
|
@@ -2052,7 +2052,7 @@ function resolveImplicitTailwindcssBasedirFromViteRoot(root) {
|
|
|
2052
2052
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
2053
2053
|
const rewriteCssImportsSpecified = Object.hasOwn(options, "rewriteCssImports");
|
|
2054
2054
|
const hasExplicitTailwindcssBasedir = typeof options.tailwindcssBasedir === "string" && options.tailwindcssBasedir.trim().length > 0;
|
|
2055
|
-
const opts =
|
|
2055
|
+
const opts = _chunkZ6RS5OPNjs.getCompilerContext.call(void 0, options);
|
|
2056
2056
|
const {
|
|
2057
2057
|
disabled,
|
|
2058
2058
|
customAttributes,
|
|
@@ -2078,8 +2078,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
2078
2078
|
if (disabledOptions.plugin) {
|
|
2079
2079
|
return rewritePlugins.length ? rewritePlugins : void 0;
|
|
2080
2080
|
}
|
|
2081
|
-
const customAttributesEntities =
|
|
2082
|
-
const patchRecorderState =
|
|
2081
|
+
const customAttributesEntities = _chunkZ6RS5OPNjs.toCustomAttributesEntities.call(void 0, customAttributes);
|
|
2082
|
+
const patchRecorderState = _chunkZ6RS5OPNjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
2083
2083
|
source: "runtime",
|
|
2084
2084
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
2085
2085
|
});
|
|
@@ -2118,7 +2118,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
2118
2118
|
async function refreshRuntimeState(force) {
|
|
2119
2119
|
const invalidation = resolveRuntimeRefreshOptions();
|
|
2120
2120
|
const shouldRefresh = force || invalidation.changed;
|
|
2121
|
-
const refreshed = await
|
|
2121
|
+
const refreshed = await _chunkZ6RS5OPNjs.refreshTailwindRuntimeState.call(void 0, runtimeState, {
|
|
2122
2122
|
force: shouldRefresh,
|
|
2123
2123
|
clearCache: force || invalidation.changed
|
|
2124
2124
|
});
|
|
@@ -2139,7 +2139,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
2139
2139
|
}
|
|
2140
2140
|
if (forceRuntimeRefresh || !runtimeSetPromise) {
|
|
2141
2141
|
const invalidation = resolveRuntimeRefreshOptions();
|
|
2142
|
-
const task2 =
|
|
2142
|
+
const task2 = _chunkZ6RS5OPNjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
|
|
2143
2143
|
force: forceRuntimeRefresh || invalidation.changed,
|
|
2144
2144
|
skipRefresh: forceRuntimeRefresh,
|
|
2145
2145
|
clearCache: forceRuntimeRefresh || invalidation.changed
|
|
@@ -2181,7 +2181,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
2181
2181
|
if (!forceRuntimeRefresh && !invalidation.changed && !forceCollectBySource && runtimeSet) {
|
|
2182
2182
|
return runtimeSet;
|
|
2183
2183
|
}
|
|
2184
|
-
const task =
|
|
2184
|
+
const task = _chunkZ6RS5OPNjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
|
|
2185
2185
|
force: forceRuntimeRefresh || invalidation.changed || forceCollectBySource,
|
|
2186
2186
|
skipRefresh: forceRuntimeRefresh,
|
|
2187
2187
|
clearCache: forceRuntimeRefresh || invalidation.changed
|
|
@@ -2216,7 +2216,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
2216
2216
|
const plugins = [
|
|
2217
2217
|
...rewritePlugins,
|
|
2218
2218
|
{
|
|
2219
|
-
name: `${
|
|
2219
|
+
name: `${_chunkZ6RS5OPNjs.vitePluginName}:post`,
|
|
2220
2220
|
enforce: "post",
|
|
2221
2221
|
async configResolved(config) {
|
|
2222
2222
|
resolvedConfig = config;
|
|
@@ -423,7 +423,7 @@ import { logger as logger2 } from "@weapp-tailwindcss/logger";
|
|
|
423
423
|
// package.json
|
|
424
424
|
var package_default = {
|
|
425
425
|
name: "weapp-tailwindcss",
|
|
426
|
-
version: "4.11.0
|
|
426
|
+
version: "4.11.0",
|
|
427
427
|
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!",
|
|
428
428
|
author: "ice breaker <1324318532@qq.com>",
|
|
429
429
|
license: "MIT",
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
isMpx,
|
|
12
12
|
patchMpxLoaderResolve,
|
|
13
13
|
setupMpxTailwindcssRedirect
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-MAIS4SDW.mjs";
|
|
15
15
|
import {
|
|
16
16
|
pushConcurrentTaskFactories,
|
|
17
17
|
resolveDisabledOptions,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
getCompilerContext,
|
|
29
29
|
pluginName,
|
|
30
30
|
setupPatchRecorder
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-KWSWZP5H.mjs";
|
|
32
32
|
import {
|
|
33
33
|
getRuntimeClassSetSignature,
|
|
34
34
|
resolveTailwindcssOptions
|
|
@@ -423,7 +423,7 @@ function getRecordFileCandidates(baseDir) {
|
|
|
423
423
|
// package.json
|
|
424
424
|
var package_default = {
|
|
425
425
|
name: "weapp-tailwindcss",
|
|
426
|
-
version: "4.11.0
|
|
426
|
+
version: "4.11.0",
|
|
427
427
|
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!",
|
|
428
428
|
author: "ice breaker <1324318532@qq.com>",
|
|
429
429
|
license: "MIT",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunk7LKMJZD2js = require('./chunk-7LKMJZD2.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkZ6RS5OPNjs = require('./chunk-Z6RS5OPN.js');
|
|
7
7
|
|
|
8
8
|
// src/shared/mpx.ts
|
|
9
9
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
@@ -155,8 +155,8 @@ function applyTailwindcssCssImportRewrite(compiler, options) {
|
|
|
155
155
|
if (!options.enabled) {
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
|
-
compiler.hooks.normalModuleFactory.tap(
|
|
159
|
-
factory.hooks.beforeResolve.tap(
|
|
158
|
+
compiler.hooks.normalModuleFactory.tap(_chunkZ6RS5OPNjs.pluginName, (factory) => {
|
|
159
|
+
factory.hooks.beforeResolve.tap(_chunkZ6RS5OPNjs.pluginName, (data) => {
|
|
160
160
|
rewriteTailwindcssRequestForCss(data, options.pkgDir, options.appType);
|
|
161
161
|
});
|
|
162
162
|
});
|
package/dist/cli.js
CHANGED
|
@@ -179,7 +179,7 @@ var import_logger = require("@weapp-tailwindcss/logger");
|
|
|
179
179
|
// package.json
|
|
180
180
|
var package_default = {
|
|
181
181
|
name: "weapp-tailwindcss",
|
|
182
|
-
version: "4.11.0
|
|
182
|
+
version: "4.11.0",
|
|
183
183
|
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!",
|
|
184
184
|
author: "ice breaker <1324318532@qq.com>",
|
|
185
185
|
license: "MIT",
|
package/dist/cli.mjs
CHANGED
|
@@ -155,7 +155,7 @@ import { logger } from "@weapp-tailwindcss/logger";
|
|
|
155
155
|
// package.json
|
|
156
156
|
var package_default = {
|
|
157
157
|
name: "weapp-tailwindcss",
|
|
158
|
-
version: "4.11.0
|
|
158
|
+
version: "4.11.0",
|
|
159
159
|
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!",
|
|
160
160
|
author: "ice breaker <1324318532@qq.com>",
|
|
161
161
|
license: "MIT",
|
package/dist/core.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkZ6RS5OPNjs = require('./chunk-Z6RS5OPN.js');
|
|
6
6
|
require('./chunk-QK6VNNNL.js');
|
|
7
7
|
require('./chunk-LL3QUKJI.js');
|
|
8
8
|
require('./chunk-DYLQ6UOI.js');
|
|
@@ -24,9 +24,9 @@ function resolveTransformWxssOptions(options) {
|
|
|
24
24
|
return _shared.defuOverrideArray.call(void 0, options, DEFAULT_MAIN_CHUNK_STYLE_OPTIONS);
|
|
25
25
|
}
|
|
26
26
|
function createContext(options = {}) {
|
|
27
|
-
const opts =
|
|
27
|
+
const opts = _chunkZ6RS5OPNjs.getCompilerContext.call(void 0, options);
|
|
28
28
|
const { templateHandler, styleHandler, jsHandler, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
29
|
-
const patchRecorderState =
|
|
29
|
+
const patchRecorderState = _chunkZ6RS5OPNjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
30
30
|
source: "runtime",
|
|
31
31
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
32
32
|
});
|
|
@@ -143,7 +143,7 @@ function createContext(options = {}) {
|
|
|
143
143
|
async function transformWxss(rawCss, options2) {
|
|
144
144
|
await runtimeState.patchPromise;
|
|
145
145
|
const result = await styleHandler(rawCss, resolveTransformWxssOptions(options2));
|
|
146
|
-
runtimeSet = await
|
|
146
|
+
runtimeSet = await _chunkZ6RS5OPNjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
147
147
|
forceRefresh: true,
|
|
148
148
|
forceCollect: true
|
|
149
149
|
});
|
|
@@ -154,7 +154,7 @@ function createContext(options = {}) {
|
|
|
154
154
|
if (_optionalChain([options2, 'optionalAccess', _ => _.runtimeSet])) {
|
|
155
155
|
runtimeSet = options2.runtimeSet;
|
|
156
156
|
} else if (runtimeSet.size === 0) {
|
|
157
|
-
runtimeSet = await
|
|
157
|
+
runtimeSet = await _chunkZ6RS5OPNjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
158
158
|
forceCollect: true
|
|
159
159
|
});
|
|
160
160
|
}
|
|
@@ -163,7 +163,7 @@ function createContext(options = {}) {
|
|
|
163
163
|
async function transformWxml(rawWxml, options2) {
|
|
164
164
|
await runtimeState.patchPromise;
|
|
165
165
|
if (!_optionalChain([options2, 'optionalAccess', _2 => _2.runtimeSet]) && runtimeSet.size === 0) {
|
|
166
|
-
runtimeSet = await
|
|
166
|
+
runtimeSet = await _chunkZ6RS5OPNjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
167
167
|
forceCollect: true
|
|
168
168
|
});
|
|
169
169
|
}
|
package/dist/core.mjs
CHANGED
package/dist/gulp.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkC4CWDYUPjs = require('./chunk-C4CWDYUP.js');
|
|
4
4
|
require('./chunk-OF6MFURR.js');
|
|
5
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-Z6RS5OPN.js');
|
|
6
6
|
require('./chunk-QK6VNNNL.js');
|
|
7
7
|
require('./chunk-LL3QUKJI.js');
|
|
8
8
|
require('./chunk-DYLQ6UOI.js');
|
|
@@ -10,4 +10,4 @@ require('./chunk-CRDOWYG4.js');
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.createPlugins =
|
|
13
|
+
exports.createPlugins = _chunkC4CWDYUPjs.createPlugins; exports.weappTailwindcss = _chunkC4CWDYUPjs.createPlugins;
|
package/dist/gulp.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPlugins
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FTFADUJ4.mjs";
|
|
4
4
|
import "./chunk-76S2EME4.mjs";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-KWSWZP5H.mjs";
|
|
6
6
|
import "./chunk-OMARW5NC.mjs";
|
|
7
7
|
import "./chunk-23K4XDKF.mjs";
|
|
8
8
|
import "./chunk-OOHJLO5M.mjs";
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var _chunk2PXISDSYjs = require('./chunk-2PXISDSY.js');
|
|
5
|
+
require('./chunk-ZQAWDXIW.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkC4CWDYUPjs = require('./chunk-C4CWDYUP.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkGVYD6TY7js = require('./chunk-GVYD6TY7.js');
|
|
12
12
|
require('./chunk-7LKMJZD2.js');
|
|
13
13
|
require('./chunk-OF6MFURR.js');
|
|
14
|
-
require('./chunk-
|
|
14
|
+
require('./chunk-Z6RS5OPN.js');
|
|
15
15
|
require('./chunk-QK6VNNNL.js');
|
|
16
16
|
require('./chunk-LL3QUKJI.js');
|
|
17
17
|
require('./chunk-DYLQ6UOI.js');
|
|
@@ -21,4 +21,4 @@ require('./chunk-CRDOWYG4.js');
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
exports.UnifiedViteWeappTailwindcssPlugin =
|
|
24
|
+
exports.UnifiedViteWeappTailwindcssPlugin = _chunkGVYD6TY7js.UnifiedViteWeappTailwindcssPlugin; exports.UnifiedWebpackPluginV5 = _chunk2PXISDSYjs.UnifiedWebpackPluginV5; exports.createPlugins = _chunkC4CWDYUPjs.createPlugins; exports.weappTailwindcssPackageDir = _chunk2PXISDSYjs.weappTailwindcssPackageDir;
|
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedWebpackPluginV5,
|
|
3
3
|
weappTailwindcssPackageDir
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-Y75XZ6KA.mjs";
|
|
5
|
+
import "./chunk-MAIS4SDW.mjs";
|
|
6
6
|
import {
|
|
7
7
|
createPlugins
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FTFADUJ4.mjs";
|
|
9
9
|
import {
|
|
10
10
|
UnifiedViteWeappTailwindcssPlugin
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-UO725AHQ.mjs";
|
|
12
12
|
import "./chunk-F2CKKG6Q.mjs";
|
|
13
13
|
import "./chunk-76S2EME4.mjs";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-KWSWZP5H.mjs";
|
|
15
15
|
import "./chunk-OMARW5NC.mjs";
|
|
16
16
|
import "./chunk-23K4XDKF.mjs";
|
|
17
17
|
import "./chunk-OOHJLO5M.mjs";
|
package/dist/vite.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkGVYD6TY7js = require('./chunk-GVYD6TY7.js');
|
|
4
4
|
require('./chunk-7LKMJZD2.js');
|
|
5
5
|
require('./chunk-OF6MFURR.js');
|
|
6
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-Z6RS5OPN.js');
|
|
7
7
|
require('./chunk-QK6VNNNL.js');
|
|
8
8
|
require('./chunk-LL3QUKJI.js');
|
|
9
9
|
require('./chunk-DYLQ6UOI.js');
|
|
@@ -11,4 +11,4 @@ require('./chunk-CRDOWYG4.js');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.UnifiedViteWeappTailwindcssPlugin =
|
|
14
|
+
exports.UnifiedViteWeappTailwindcssPlugin = _chunkGVYD6TY7js.UnifiedViteWeappTailwindcssPlugin; exports.weappTailwindcss = _chunkGVYD6TY7js.UnifiedViteWeappTailwindcssPlugin;
|
package/dist/vite.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedViteWeappTailwindcssPlugin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UO725AHQ.mjs";
|
|
4
4
|
import "./chunk-F2CKKG6Q.mjs";
|
|
5
5
|
import "./chunk-76S2EME4.mjs";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-KWSWZP5H.mjs";
|
|
7
7
|
import "./chunk-OMARW5NC.mjs";
|
|
8
8
|
import "./chunk-23K4XDKF.mjs";
|
|
9
9
|
import "./chunk-OOHJLO5M.mjs";
|
package/dist/webpack.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var _chunk2PXISDSYjs = require('./chunk-2PXISDSY.js');
|
|
5
|
+
require('./chunk-ZQAWDXIW.js');
|
|
6
6
|
require('./chunk-7LKMJZD2.js');
|
|
7
7
|
require('./chunk-OF6MFURR.js');
|
|
8
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-Z6RS5OPN.js');
|
|
9
9
|
require('./chunk-QK6VNNNL.js');
|
|
10
10
|
require('./chunk-LL3QUKJI.js');
|
|
11
11
|
require('./chunk-DYLQ6UOI.js');
|
|
@@ -14,4 +14,4 @@ require('./chunk-CRDOWYG4.js');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.UnifiedWebpackPluginV5 =
|
|
17
|
+
exports.UnifiedWebpackPluginV5 = _chunk2PXISDSYjs.UnifiedWebpackPluginV5; exports.weappTailwindcss = _chunk2PXISDSYjs.UnifiedWebpackPluginV5; exports.weappTailwindcssPackageDir = _chunk2PXISDSYjs.weappTailwindcssPackageDir;
|
package/dist/webpack.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedWebpackPluginV5,
|
|
3
3
|
weappTailwindcssPackageDir
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-Y75XZ6KA.mjs";
|
|
5
|
+
import "./chunk-MAIS4SDW.mjs";
|
|
6
6
|
import "./chunk-F2CKKG6Q.mjs";
|
|
7
7
|
import "./chunk-76S2EME4.mjs";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-KWSWZP5H.mjs";
|
|
9
9
|
import "./chunk-OMARW5NC.mjs";
|
|
10
10
|
import "./chunk-23K4XDKF.mjs";
|
|
11
11
|
import "./chunk-OOHJLO5M.mjs";
|
package/dist/webpack4.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkZQAWDXIWjs = require('./chunk-ZQAWDXIW.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -27,7 +27,7 @@ var _chunkOF6MFURRjs = require('./chunk-OF6MFURR.js');
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _chunkZ6RS5OPNjs = require('./chunk-Z6RS5OPN.js');
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
var _chunkQK6VNNNLjs = require('./chunk-QK6VNNNL.js');
|
|
@@ -59,7 +59,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
59
59
|
debug: debug2
|
|
60
60
|
} = options;
|
|
61
61
|
const cssHandlerOptionsCache = /* @__PURE__ */ new Map();
|
|
62
|
-
compiler.hooks.emit.tapPromise(
|
|
62
|
+
compiler.hooks.emit.tapPromise(_chunkZ6RS5OPNjs.pluginName, async (compilation) => {
|
|
63
63
|
await runtimeState.patchPromise;
|
|
64
64
|
compilerOptions.onStart();
|
|
65
65
|
debug2("start");
|
|
@@ -68,7 +68,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
68
68
|
compilerOptions.cache.calcHashValueChanged(chunk.id, chunk.hash);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
const assetHashByChunk =
|
|
71
|
+
const assetHashByChunk = _chunkZQAWDXIWjs.createAssetHashByChunkMap.call(void 0, compilation.chunks);
|
|
72
72
|
const assets = compilation.assets;
|
|
73
73
|
const entries = Object.entries(assets);
|
|
74
74
|
const outputDir = _optionalChain([compiler, 'access', _ => _.options, 'optionalAccess', _2 => _2.output, 'optionalAccess', _3 => _3.path]) ? _path2.default.resolve(compiler.options.output.path) : _process2.default.cwd();
|
|
@@ -145,7 +145,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
145
145
|
return created;
|
|
146
146
|
};
|
|
147
147
|
const staleClassNameFallback = resolveWebpackStaleClassNameFallback(compilerOptions.staleClassNameFallback, compiler);
|
|
148
|
-
const runtimeSet = await
|
|
148
|
+
const runtimeSet = await _chunkZ6RS5OPNjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
149
149
|
// webpack 的 script-only 热更新可能不会触发 runtime classset loader,
|
|
150
150
|
// 这里强制收集可避免沿用上轮 class set,保证 JS 仅按最新集合精确命中。
|
|
151
151
|
forceCollect: true,
|
|
@@ -191,7 +191,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
191
191
|
const jsTaskFactories = [];
|
|
192
192
|
if (Array.isArray(groupedEntries.js)) {
|
|
193
193
|
for (const [file] of groupedEntries.js) {
|
|
194
|
-
const cacheKey =
|
|
194
|
+
const cacheKey = _chunkZQAWDXIWjs.getCacheKey.call(void 0, file);
|
|
195
195
|
const assetSource = compilation.assets[file];
|
|
196
196
|
if (!assetSource) {
|
|
197
197
|
continue;
|
|
@@ -295,9 +295,9 @@ function setupWebpackV4Loaders(options) {
|
|
|
295
295
|
getClassSetInLoader,
|
|
296
296
|
debug: debug2
|
|
297
297
|
} = options;
|
|
298
|
-
const isMpxApp =
|
|
298
|
+
const isMpxApp = _chunkZQAWDXIWjs.isMpx.call(void 0, appType);
|
|
299
299
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
300
|
-
|
|
300
|
+
_chunkZQAWDXIWjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
|
|
301
301
|
}
|
|
302
302
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
303
303
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -310,12 +310,12 @@ function setupWebpackV4Loaders(options) {
|
|
|
310
310
|
const classSetLoaderOptions = {
|
|
311
311
|
getClassSet: getClassSetInLoader
|
|
312
312
|
};
|
|
313
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
313
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunkZQAWDXIWjs.createLoaderAnchorFinders.call(void 0, appType);
|
|
314
314
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
315
315
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
316
316
|
} : void 0;
|
|
317
317
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
318
|
-
|
|
318
|
+
_chunkZQAWDXIWjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
319
319
|
}
|
|
320
320
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
321
321
|
loader: runtimeClassSetLoader,
|
|
@@ -334,19 +334,19 @@ function setupWebpackV4Loaders(options) {
|
|
|
334
334
|
type: null
|
|
335
335
|
};
|
|
336
336
|
};
|
|
337
|
-
compiler.hooks.compilation.tap(
|
|
338
|
-
compilation.hooks.normalModuleLoader.tap(
|
|
337
|
+
compiler.hooks.compilation.tap(_chunkZ6RS5OPNjs.pluginName, (compilation) => {
|
|
338
|
+
compilation.hooks.normalModuleLoader.tap(_chunkZ6RS5OPNjs.pluginName, (_loaderContext, module) => {
|
|
339
339
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
340
340
|
if (!hasRuntimeLoader) {
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
if (shouldRewriteCssImports &&
|
|
344
|
-
|
|
343
|
+
if (shouldRewriteCssImports && _chunkZQAWDXIWjs.isMpx.call(void 0, appType) && typeof _loaderContext.resolve === "function") {
|
|
344
|
+
_chunkZQAWDXIWjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, true);
|
|
345
345
|
}
|
|
346
346
|
const loaderEntries = module.loaders || [];
|
|
347
347
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
348
348
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
349
|
-
const isCssModule =
|
|
349
|
+
const isCssModule = _chunkZQAWDXIWjs.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
|
|
350
350
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
351
351
|
debug2("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
352
352
|
}
|
|
@@ -380,7 +380,7 @@ function setupWebpackV4Loaders(options) {
|
|
|
380
380
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
|
-
if (runtimeClassSetLoaderExists && !
|
|
383
|
+
if (runtimeClassSetLoaderExists && !_chunkZQAWDXIWjs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
384
384
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
385
385
|
if (anchorIndex === -1) {
|
|
386
386
|
anchorlessInsert(createRuntimeClassSetLoaderEntry(), "before");
|
|
@@ -394,11 +394,11 @@ function setupWebpackV4Loaders(options) {
|
|
|
394
394
|
}
|
|
395
395
|
|
|
396
396
|
// src/bundlers/webpack/BaseUnifiedPlugin/v4.ts
|
|
397
|
-
var debug =
|
|
397
|
+
var debug = _chunkZ6RS5OPNjs.createDebug.call(void 0, );
|
|
398
398
|
var weappTailwindcssPackageDir = _chunk7LKMJZD2js.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
399
399
|
var UnifiedWebpackPluginV4 = class {
|
|
400
400
|
constructor(options = {}) {
|
|
401
|
-
this.options =
|
|
401
|
+
this.options = _chunkZ6RS5OPNjs.getCompilerContext.call(void 0, options);
|
|
402
402
|
this.appType = this.options.appType;
|
|
403
403
|
}
|
|
404
404
|
apply(compiler) {
|
|
@@ -414,19 +414,19 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
414
414
|
const disabledOptions = _chunk7LKMJZD2js.resolveDisabledOptions.call(void 0, disabled);
|
|
415
415
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
416
416
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
417
|
-
const isMpxApp =
|
|
417
|
+
const isMpxApp = _chunkZQAWDXIWjs.isMpx.call(void 0, this.appType);
|
|
418
418
|
if (shouldRewriteCssImports) {
|
|
419
|
-
|
|
419
|
+
_chunkZQAWDXIWjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
420
420
|
pkgDir: weappTailwindcssPackageDir,
|
|
421
421
|
enabled: true,
|
|
422
422
|
appType: this.appType
|
|
423
423
|
});
|
|
424
|
-
|
|
424
|
+
_chunkZQAWDXIWjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
425
425
|
}
|
|
426
426
|
if (disabledOptions.plugin) {
|
|
427
427
|
return;
|
|
428
428
|
}
|
|
429
|
-
const patchRecorderState =
|
|
429
|
+
const patchRecorderState = _chunkZ6RS5OPNjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
430
430
|
source: "runtime",
|
|
431
431
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
432
432
|
});
|
|
@@ -438,7 +438,7 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
438
438
|
};
|
|
439
439
|
let runtimeSetPrepared = false;
|
|
440
440
|
let runtimeSetSignature;
|
|
441
|
-
compiler.hooks.compilation.tap(
|
|
441
|
+
compiler.hooks.compilation.tap(_chunkZ6RS5OPNjs.pluginName, () => {
|
|
442
442
|
runtimeSetPrepared = false;
|
|
443
443
|
});
|
|
444
444
|
async function getClassSetInLoader() {
|
|
@@ -448,7 +448,7 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
448
448
|
const signature = _chunkQK6VNNNLjs.getRuntimeClassSetSignature.call(void 0, runtimeState.twPatcher);
|
|
449
449
|
const forceRefresh = signature !== runtimeSetSignature;
|
|
450
450
|
runtimeSetPrepared = true;
|
|
451
|
-
await
|
|
451
|
+
await _chunkZ6RS5OPNjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
452
452
|
forceRefresh,
|
|
453
453
|
forceCollect: true,
|
|
454
454
|
clearCache: forceRefresh,
|
package/dist/webpack4.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
isMpx,
|
|
11
11
|
patchMpxLoaderResolve,
|
|
12
12
|
setupMpxTailwindcssRedirect
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-MAIS4SDW.mjs";
|
|
14
14
|
import {
|
|
15
15
|
pushConcurrentTaskFactories,
|
|
16
16
|
resolveDisabledOptions,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
getCompilerContext,
|
|
28
28
|
pluginName,
|
|
29
29
|
setupPatchRecorder
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-KWSWZP5H.mjs";
|
|
31
31
|
import {
|
|
32
32
|
getRuntimeClassSetSignature
|
|
33
33
|
} from "./chunk-OMARW5NC.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
|
-
"version": "4.11.0
|
|
3
|
+
"version": "4.11.0",
|
|
4
4
|
"description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -185,9 +185,9 @@
|
|
|
185
185
|
"tailwindcss-patch": "9.0.0",
|
|
186
186
|
"webpack-sources": "3.3.4",
|
|
187
187
|
"yaml": "^2.8.3",
|
|
188
|
-
"@weapp-tailwindcss/postcss": "2.1.6-alpha.2",
|
|
189
188
|
"@weapp-tailwindcss/logger": "1.1.0",
|
|
190
|
-
"@weapp-tailwindcss/
|
|
189
|
+
"@weapp-tailwindcss/postcss": "2.1.6",
|
|
190
|
+
"@weapp-tailwindcss/shared": "1.1.3"
|
|
191
191
|
},
|
|
192
192
|
"scripts": {
|
|
193
193
|
"dev": "tsup --watch --sourcemap",
|