weapp-tailwindcss 4.11.0-alpha.2 → 4.11.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-6O7HJU2F.js → chunk-APTYSWEQ.js} +28 -28
- package/dist/{chunk-4TTPYMVM.js → chunk-CBZ7BRNV.js} +3 -3
- package/dist/{chunk-UCUAXK7F.mjs → chunk-DFHWHTMB.mjs} +1 -1
- package/dist/{chunk-2W24MRCQ.js → chunk-JS74G7LK.js} +6 -6
- package/dist/{chunk-K7CZXT46.js → chunk-KIEB7M3C.js} +16 -16
- package/dist/{chunk-HADJCWHU.mjs → chunk-NAW56TSQ.mjs} +1 -1
- package/dist/{chunk-RED7Y22U.mjs → chunk-NYDCSSXH.mjs} +2 -2
- package/dist/{chunk-SJ3SG6DU.mjs → chunk-QO7CF2RF.mjs} +1 -1
- package/dist/{chunk-66E76FQE.mjs → chunk-SRMDDOZQ.mjs} +1 -1
- package/dist/{chunk-LYGLQCWI.js → chunk-V3CX3X6I.js} +1 -1
- 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 _chunkCBZ7BRNVjs = require('./chunk-CBZ7BRNV.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 _chunkV3CX3X6Ijs = require('./chunk-V3CX3X6I.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(_chunkV3CX3X6Ijs.pluginName, (compilation) => {
|
|
67
67
|
compilation.hooks.processAssets.tapPromise(
|
|
68
68
|
{
|
|
69
|
-
name:
|
|
69
|
+
name: _chunkV3CX3X6Ijs.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 = _chunkCBZ7BRNVjs.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 _chunkV3CX3X6Ijs.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 = _chunkCBZ7BRNVjs.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 = _chunkCBZ7BRNVjs.isMpx.call(void 0, appType);
|
|
317
317
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
318
|
-
|
|
318
|
+
_chunkCBZ7BRNVjs.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 } = _chunkCBZ7BRNVjs.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
|
+
_chunkCBZ7BRNVjs.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(_chunkV3CX3X6Ijs.pluginName, (compilation) => {
|
|
358
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(_chunkV3CX3X6Ijs.pluginName, (_loaderContext, module) => {
|
|
359
359
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
360
360
|
if (!hasRuntimeLoader) {
|
|
361
361
|
return;
|
|
362
362
|
}
|
|
363
|
-
|
|
363
|
+
_chunkCBZ7BRNVjs.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 = _chunkCBZ7BRNVjs.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 && !_chunkCBZ7BRNVjs.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 = _chunkV3CX3X6Ijs.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 = _chunkV3CX3X6Ijs.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 = _chunkCBZ7BRNVjs.isMpx.call(void 0, this.appType);
|
|
435
435
|
if (shouldRewriteCssImports) {
|
|
436
|
-
|
|
436
|
+
_chunkCBZ7BRNVjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
437
437
|
pkgDir: weappTailwindcssPackageDir,
|
|
438
438
|
enabled: true,
|
|
439
439
|
appType: this.appType
|
|
440
440
|
});
|
|
441
|
-
|
|
441
|
+
_chunkCBZ7BRNVjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
442
442
|
}
|
|
443
443
|
if (disabledOptions.plugin) {
|
|
444
444
|
return;
|
|
445
445
|
}
|
|
446
|
-
const patchRecorderState =
|
|
446
|
+
const patchRecorderState = _chunkV3CX3X6Ijs.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 || _chunkCBZ7BRNVjs.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(_chunkV3CX3X6Ijs.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(_chunkV3CX3X6Ijs.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(_chunkV3CX3X6Ijs.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(_chunkV3CX3X6Ijs.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 _chunkV3CX3X6Ijs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
529
529
|
forceRefresh,
|
|
530
530
|
forceCollect: true,
|
|
531
531
|
clearCache: forceRefresh,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunk7LKMJZD2js = require('./chunk-7LKMJZD2.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkV3CX3X6Ijs = require('./chunk-V3CX3X6I.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(_chunkV3CX3X6Ijs.pluginName, (factory) => {
|
|
159
|
+
factory.hooks.beforeResolve.tap(_chunkV3CX3X6Ijs.pluginName, (data) => {
|
|
160
160
|
rewriteTailwindcssRequestForCss(data, options.pkgDir, options.appType);
|
|
161
161
|
});
|
|
162
162
|
});
|
|
@@ -7,7 +7,7 @@ var _chunkOF6MFURRjs = require('./chunk-OF6MFURR.js');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkV3CX3X6Ijs = require('./chunk-V3CX3X6I.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 = _chunkV3CX3X6Ijs.createDebug.call(void 0, );
|
|
19
19
|
var Transform = _stream2.default.Transform;
|
|
20
20
|
function createPlugins(options = {}) {
|
|
21
|
-
const opts =
|
|
21
|
+
const opts = _chunkV3CX3X6Ijs.getCompilerContext.call(void 0, options);
|
|
22
22
|
const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
23
|
-
const patchRecorderState =
|
|
23
|
+
const patchRecorderState = _chunkV3CX3X6Ijs.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 _chunkV3CX3X6Ijs.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 _chunkV3CX3X6Ijs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
48
48
|
forceRefresh: force,
|
|
49
49
|
forceCollect: force,
|
|
50
50
|
clearCache: force,
|
|
@@ -23,7 +23,7 @@ var _chunkOF6MFURRjs = require('./chunk-OF6MFURR.js');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkV3CX3X6Ijs = require('./chunk-V3CX3X6I.js');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
@@ -64,7 +64,7 @@ function updateStaticAttribute(ms, prop) {
|
|
|
64
64
|
const start = prop.value.loc.start.offset + 1;
|
|
65
65
|
const end = prop.value.loc.end.offset - 1;
|
|
66
66
|
if (start < end) {
|
|
67
|
-
ms.update(start, end,
|
|
67
|
+
ms.update(start, end, _chunkV3CX3X6Ijs.replaceWxml.call(void 0, prop.value.content));
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
@@ -76,7 +76,7 @@ function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
|
76
76
|
if (start >= end) {
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
|
-
const generated =
|
|
79
|
+
const generated = _chunkV3CX3X6Ijs.generateCode.call(void 0, prop.exp.content, {
|
|
80
80
|
jsHandler,
|
|
81
81
|
runtimeSet,
|
|
82
82
|
wrapExpression: true
|
|
@@ -106,7 +106,7 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
108
|
const { customAttributesEntities, disabledDefaultTemplateHandler = false } = options;
|
|
109
|
-
const matchCustomAttribute =
|
|
109
|
+
const matchCustomAttribute = _chunkV3CX3X6Ijs.createAttributeMatcher.call(void 0, customAttributesEntities);
|
|
110
110
|
const ms = new (0, _magicstring2.default)(code);
|
|
111
111
|
const { descriptor, errors } = _compilersfc.parse.call(void 0, code);
|
|
112
112
|
if (errors.length === 0) {
|
|
@@ -530,14 +530,14 @@ function createHtmlRuntimeAffectingSignature(source) {
|
|
|
530
530
|
}
|
|
531
531
|
function createJsRuntimeAffectingSignature(source) {
|
|
532
532
|
try {
|
|
533
|
-
const ast =
|
|
533
|
+
const ast = _chunkV3CX3X6Ijs.babelParse.call(void 0, source, {
|
|
534
534
|
cache: true,
|
|
535
535
|
cacheKey: "vite-runtime-affecting:unambiguous",
|
|
536
536
|
plugins: ["jsx", "typescript"],
|
|
537
537
|
sourceType: "unambiguous"
|
|
538
538
|
});
|
|
539
539
|
const parts = [];
|
|
540
|
-
|
|
540
|
+
_chunkV3CX3X6Ijs.traverse.call(void 0, ast, {
|
|
541
541
|
noScope: true,
|
|
542
542
|
StringLiteral(path5) {
|
|
543
543
|
parts.push(`s:${path5.node.value}`);
|
|
@@ -1319,7 +1319,7 @@ var _module = require('module');
|
|
|
1319
1319
|
|
|
1320
1320
|
|
|
1321
1321
|
var _tailwindcsspatch = require('tailwindcss-patch');
|
|
1322
|
-
var debug =
|
|
1322
|
+
var debug = _chunkV3CX3X6Ijs.createDebug.call(void 0, "[vite:runtime-set] ");
|
|
1323
1323
|
var require2 = _module.createRequire.call(void 0, _chunkCRDOWYG4js.importMetaUrl);
|
|
1324
1324
|
var EXTENSION_DOT_PREFIX_RE = /^\./;
|
|
1325
1325
|
var VALIDATION_FILE_NAME = "runtime-candidates.html";
|
|
@@ -1690,7 +1690,7 @@ function createRewriteCssImportsPlugins(options) {
|
|
|
1690
1690
|
const { appType, weappTailwindcssDirPosix: weappTailwindcssDirPosix2 } = options;
|
|
1691
1691
|
return [
|
|
1692
1692
|
{
|
|
1693
|
-
name: `${
|
|
1693
|
+
name: `${_chunkV3CX3X6Ijs.vitePluginName}:rewrite-css-imports`,
|
|
1694
1694
|
enforce: "pre",
|
|
1695
1695
|
resolveId: {
|
|
1696
1696
|
order: "pre",
|
|
@@ -1732,7 +1732,7 @@ function createRewriteCssImportsPlugins(options) {
|
|
|
1732
1732
|
}
|
|
1733
1733
|
|
|
1734
1734
|
// src/bundlers/vite/index.ts
|
|
1735
|
-
var debug2 =
|
|
1735
|
+
var debug2 = _chunkV3CX3X6Ijs.createDebug.call(void 0, );
|
|
1736
1736
|
var weappTailwindcssPackageDir = _chunk7LKMJZD2js.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
1737
1737
|
var weappTailwindcssDirPosix = slash(weappTailwindcssPackageDir);
|
|
1738
1738
|
var PACKAGE_JSON_FILE = "package.json";
|
|
@@ -1764,7 +1764,7 @@ function resolveImplicitTailwindcssBasedirFromViteRoot(root) {
|
|
|
1764
1764
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
1765
1765
|
const rewriteCssImportsSpecified = Object.hasOwn(options, "rewriteCssImports");
|
|
1766
1766
|
const hasExplicitTailwindcssBasedir = typeof options.tailwindcssBasedir === "string" && options.tailwindcssBasedir.trim().length > 0;
|
|
1767
|
-
const opts =
|
|
1767
|
+
const opts = _chunkV3CX3X6Ijs.getCompilerContext.call(void 0, options);
|
|
1768
1768
|
const {
|
|
1769
1769
|
disabled,
|
|
1770
1770
|
customAttributes,
|
|
@@ -1789,8 +1789,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
1789
1789
|
if (disabledOptions.plugin) {
|
|
1790
1790
|
return rewritePlugins.length ? rewritePlugins : void 0;
|
|
1791
1791
|
}
|
|
1792
|
-
const customAttributesEntities =
|
|
1793
|
-
const patchRecorderState =
|
|
1792
|
+
const customAttributesEntities = _chunkV3CX3X6Ijs.toCustomAttributesEntities.call(void 0, customAttributes);
|
|
1793
|
+
const patchRecorderState = _chunkV3CX3X6Ijs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
1794
1794
|
source: "runtime",
|
|
1795
1795
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
1796
1796
|
});
|
|
@@ -1829,7 +1829,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
1829
1829
|
async function refreshRuntimeState(force) {
|
|
1830
1830
|
const invalidation = resolveRuntimeRefreshOptions();
|
|
1831
1831
|
const shouldRefresh = force || invalidation.changed;
|
|
1832
|
-
const refreshed = await
|
|
1832
|
+
const refreshed = await _chunkV3CX3X6Ijs.refreshTailwindRuntimeState.call(void 0, runtimeState, {
|
|
1833
1833
|
force: shouldRefresh,
|
|
1834
1834
|
clearCache: force || invalidation.changed
|
|
1835
1835
|
});
|
|
@@ -1850,7 +1850,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
1850
1850
|
}
|
|
1851
1851
|
if (forceRuntimeRefresh || !runtimeSetPromise) {
|
|
1852
1852
|
const invalidation = resolveRuntimeRefreshOptions();
|
|
1853
|
-
const task2 =
|
|
1853
|
+
const task2 = _chunkV3CX3X6Ijs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
|
|
1854
1854
|
force: forceRuntimeRefresh || invalidation.changed,
|
|
1855
1855
|
skipRefresh: forceRuntimeRefresh,
|
|
1856
1856
|
clearCache: forceRuntimeRefresh || invalidation.changed
|
|
@@ -1892,7 +1892,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
1892
1892
|
if (!forceRuntimeRefresh && !invalidation.changed && !forceCollectBySource && runtimeSet) {
|
|
1893
1893
|
return runtimeSet;
|
|
1894
1894
|
}
|
|
1895
|
-
const task =
|
|
1895
|
+
const task = _chunkV3CX3X6Ijs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
|
|
1896
1896
|
force: forceRuntimeRefresh || invalidation.changed || forceCollectBySource,
|
|
1897
1897
|
skipRefresh: forceRuntimeRefresh,
|
|
1898
1898
|
clearCache: forceRuntimeRefresh || invalidation.changed
|
|
@@ -1926,7 +1926,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
1926
1926
|
const plugins = [
|
|
1927
1927
|
...rewritePlugins,
|
|
1928
1928
|
{
|
|
1929
|
-
name: `${
|
|
1929
|
+
name: `${_chunkV3CX3X6Ijs.vitePluginName}:post`,
|
|
1930
1930
|
enforce: "post",
|
|
1931
1931
|
async configResolved(config) {
|
|
1932
1932
|
resolvedConfig = config;
|
|
@@ -422,7 +422,7 @@ import { logger as logger2 } from "@weapp-tailwindcss/logger";
|
|
|
422
422
|
// package.json
|
|
423
423
|
var package_default = {
|
|
424
424
|
name: "weapp-tailwindcss",
|
|
425
|
-
version: "4.11.0-alpha.
|
|
425
|
+
version: "4.11.0-alpha.3",
|
|
426
426
|
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!",
|
|
427
427
|
author: "ice breaker <1324318532@qq.com>",
|
|
428
428
|
license: "MIT",
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
isMpx,
|
|
12
12
|
patchMpxLoaderResolve,
|
|
13
13
|
setupMpxTailwindcssRedirect
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-QO7CF2RF.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-NAW56TSQ.mjs";
|
|
32
32
|
import {
|
|
33
33
|
getRuntimeClassSetSignature,
|
|
34
34
|
resolveTailwindcssOptions
|
|
@@ -422,7 +422,7 @@ function getRecordFileCandidates(baseDir) {
|
|
|
422
422
|
// package.json
|
|
423
423
|
var package_default = {
|
|
424
424
|
name: "weapp-tailwindcss",
|
|
425
|
-
version: "4.11.0-alpha.
|
|
425
|
+
version: "4.11.0-alpha.3",
|
|
426
426
|
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!",
|
|
427
427
|
author: "ice breaker <1324318532@qq.com>",
|
|
428
428
|
license: "MIT",
|
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-alpha.
|
|
182
|
+
version: "4.11.0-alpha.3",
|
|
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-alpha.
|
|
158
|
+
version: "4.11.0-alpha.3",
|
|
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 _chunkV3CX3X6Ijs = require('./chunk-V3CX3X6I.js');
|
|
6
6
|
require('./chunk-5KSBT6GU.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 = _chunkV3CX3X6Ijs.getCompilerContext.call(void 0, options);
|
|
28
28
|
const { templateHandler, styleHandler, jsHandler, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
29
|
-
const patchRecorderState =
|
|
29
|
+
const patchRecorderState = _chunkV3CX3X6Ijs.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 _chunkV3CX3X6Ijs.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 _chunkV3CX3X6Ijs.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 _chunkV3CX3X6Ijs.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 _chunkJS74G7LKjs = require('./chunk-JS74G7LK.js');
|
|
4
4
|
require('./chunk-OF6MFURR.js');
|
|
5
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-V3CX3X6I.js');
|
|
6
6
|
require('./chunk-5KSBT6GU.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 = _chunkJS74G7LKjs.createPlugins; exports.weappTailwindcss = _chunkJS74G7LKjs.createPlugins;
|
package/dist/gulp.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPlugins
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DFHWHTMB.mjs";
|
|
4
4
|
import "./chunk-76S2EME4.mjs";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-NAW56TSQ.mjs";
|
|
6
6
|
import "./chunk-EW2K6CO5.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 _chunkAPTYSWEQjs = require('./chunk-APTYSWEQ.js');
|
|
5
|
+
require('./chunk-CBZ7BRNV.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkJS74G7LKjs = require('./chunk-JS74G7LK.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkKIEB7M3Cjs = require('./chunk-KIEB7M3C.js');
|
|
12
12
|
require('./chunk-7LKMJZD2.js');
|
|
13
13
|
require('./chunk-OF6MFURR.js');
|
|
14
|
-
require('./chunk-
|
|
14
|
+
require('./chunk-V3CX3X6I.js');
|
|
15
15
|
require('./chunk-5KSBT6GU.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 = _chunkKIEB7M3Cjs.UnifiedViteWeappTailwindcssPlugin; exports.UnifiedWebpackPluginV5 = _chunkAPTYSWEQjs.UnifiedWebpackPluginV5; exports.createPlugins = _chunkJS74G7LKjs.createPlugins; exports.weappTailwindcssPackageDir = _chunkAPTYSWEQjs.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-NYDCSSXH.mjs";
|
|
5
|
+
import "./chunk-QO7CF2RF.mjs";
|
|
6
6
|
import {
|
|
7
7
|
createPlugins
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DFHWHTMB.mjs";
|
|
9
9
|
import {
|
|
10
10
|
UnifiedViteWeappTailwindcssPlugin
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-SRMDDOZQ.mjs";
|
|
12
12
|
import "./chunk-F2CKKG6Q.mjs";
|
|
13
13
|
import "./chunk-76S2EME4.mjs";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-NAW56TSQ.mjs";
|
|
15
15
|
import "./chunk-EW2K6CO5.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 _chunkKIEB7M3Cjs = require('./chunk-KIEB7M3C.js');
|
|
4
4
|
require('./chunk-7LKMJZD2.js');
|
|
5
5
|
require('./chunk-OF6MFURR.js');
|
|
6
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-V3CX3X6I.js');
|
|
7
7
|
require('./chunk-5KSBT6GU.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 = _chunkKIEB7M3Cjs.UnifiedViteWeappTailwindcssPlugin; exports.weappTailwindcss = _chunkKIEB7M3Cjs.UnifiedViteWeappTailwindcssPlugin;
|
package/dist/vite.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedViteWeappTailwindcssPlugin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SRMDDOZQ.mjs";
|
|
4
4
|
import "./chunk-F2CKKG6Q.mjs";
|
|
5
5
|
import "./chunk-76S2EME4.mjs";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-NAW56TSQ.mjs";
|
|
7
7
|
import "./chunk-EW2K6CO5.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 _chunkAPTYSWEQjs = require('./chunk-APTYSWEQ.js');
|
|
5
|
+
require('./chunk-CBZ7BRNV.js');
|
|
6
6
|
require('./chunk-7LKMJZD2.js');
|
|
7
7
|
require('./chunk-OF6MFURR.js');
|
|
8
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-V3CX3X6I.js');
|
|
9
9
|
require('./chunk-5KSBT6GU.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 = _chunkAPTYSWEQjs.UnifiedWebpackPluginV5; exports.weappTailwindcss = _chunkAPTYSWEQjs.UnifiedWebpackPluginV5; exports.weappTailwindcssPackageDir = _chunkAPTYSWEQjs.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-NYDCSSXH.mjs";
|
|
5
|
+
import "./chunk-QO7CF2RF.mjs";
|
|
6
6
|
import "./chunk-F2CKKG6Q.mjs";
|
|
7
7
|
import "./chunk-76S2EME4.mjs";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-NAW56TSQ.mjs";
|
|
9
9
|
import "./chunk-EW2K6CO5.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 _chunkCBZ7BRNVjs = require('./chunk-CBZ7BRNV.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 _chunkV3CX3X6Ijs = require('./chunk-V3CX3X6I.js');
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
var _chunk5KSBT6GUjs = require('./chunk-5KSBT6GU.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(_chunkV3CX3X6Ijs.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 = _chunkCBZ7BRNVjs.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 _chunkV3CX3X6Ijs.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 = _chunkCBZ7BRNVjs.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 = _chunkCBZ7BRNVjs.isMpx.call(void 0, appType);
|
|
299
299
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
300
|
-
|
|
300
|
+
_chunkCBZ7BRNVjs.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 } = _chunkCBZ7BRNVjs.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
|
+
_chunkCBZ7BRNVjs.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(_chunkV3CX3X6Ijs.pluginName, (compilation) => {
|
|
338
|
+
compilation.hooks.normalModuleLoader.tap(_chunkV3CX3X6Ijs.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 && _chunkCBZ7BRNVjs.isMpx.call(void 0, appType) && typeof _loaderContext.resolve === "function") {
|
|
344
|
+
_chunkCBZ7BRNVjs.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 = _chunkCBZ7BRNVjs.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 && !_chunkCBZ7BRNVjs.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 = _chunkV3CX3X6Ijs.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 = _chunkV3CX3X6Ijs.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 = _chunkCBZ7BRNVjs.isMpx.call(void 0, this.appType);
|
|
418
418
|
if (shouldRewriteCssImports) {
|
|
419
|
-
|
|
419
|
+
_chunkCBZ7BRNVjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
420
420
|
pkgDir: weappTailwindcssPackageDir,
|
|
421
421
|
enabled: true,
|
|
422
422
|
appType: this.appType
|
|
423
423
|
});
|
|
424
|
-
|
|
424
|
+
_chunkCBZ7BRNVjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
425
425
|
}
|
|
426
426
|
if (disabledOptions.plugin) {
|
|
427
427
|
return;
|
|
428
428
|
}
|
|
429
|
-
const patchRecorderState =
|
|
429
|
+
const patchRecorderState = _chunkV3CX3X6Ijs.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(_chunkV3CX3X6Ijs.pluginName, () => {
|
|
442
442
|
runtimeSetPrepared = false;
|
|
443
443
|
});
|
|
444
444
|
async function getClassSetInLoader() {
|
|
@@ -448,7 +448,7 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
448
448
|
const signature = _chunk5KSBT6GUjs.getRuntimeClassSetSignature.call(void 0, runtimeState.twPatcher);
|
|
449
449
|
const forceRefresh = signature !== runtimeSetSignature;
|
|
450
450
|
runtimeSetPrepared = true;
|
|
451
|
-
await
|
|
451
|
+
await _chunkV3CX3X6Ijs.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-QO7CF2RF.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-NAW56TSQ.mjs";
|
|
31
31
|
import {
|
|
32
32
|
getRuntimeClassSetSignature
|
|
33
33
|
} from "./chunk-EW2K6CO5.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
|
-
"version": "4.11.0-alpha.
|
|
3
|
+
"version": "4.11.0-alpha.3",
|
|
4
4
|
"description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -185,8 +185,8 @@
|
|
|
185
185
|
"webpack-sources": "3.3.4",
|
|
186
186
|
"yaml": "^2.8.3",
|
|
187
187
|
"@weapp-tailwindcss/logger": "1.1.0",
|
|
188
|
-
"@weapp-tailwindcss/
|
|
189
|
-
"@weapp-tailwindcss/
|
|
188
|
+
"@weapp-tailwindcss/shared": "1.1.3-alpha.1",
|
|
189
|
+
"@weapp-tailwindcss/postcss": "2.1.6-alpha.1"
|
|
190
190
|
},
|
|
191
191
|
"scripts": {
|
|
192
192
|
"dev": "tsup --watch --sourcemap",
|