weapp-tailwindcss 4.11.2 → 4.12.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -0
- package/bin/weapp-tailwindcss.js +21 -1
- package/dist/{chunk-AV3XB6EQ.js → chunk-2A4NRLSY.js} +5 -5
- package/dist/{chunk-WJIRXC26.js → chunk-6JBFHYFM.js} +134 -128
- package/dist/{chunk-OMARW5NC.mjs → chunk-AYJ4HLWZ.mjs} +4 -2
- package/dist/{chunk-W3DXDWYC.mjs → chunk-CMNCGACY.mjs} +66 -60
- package/dist/{chunk-ZZ36BKM5.mjs → chunk-CQMHHQRN.mjs} +6 -2
- package/dist/{chunk-OYSABARD.js → chunk-E7I5TW5K.js} +3 -2
- package/dist/{chunk-7LKMJZD2.js → chunk-GMKSBLNY.js} +2 -2
- package/dist/{chunk-EFBQ4SQR.mjs → chunk-HL3US2OT.mjs} +1 -1
- package/dist/{chunk-AB2RGZQO.mjs → chunk-LWEVOVRD.mjs} +144 -76
- package/dist/{chunk-QK6VNNNL.js → chunk-NIS74SI6.js} +8 -6
- package/dist/{chunk-CRDOWYG4.js → chunk-ONLKZIRQ.js} +1 -1
- package/dist/{chunk-3QHYEMEW.js → chunk-PAAX4FDD.js} +45 -40
- package/dist/{chunk-JIERVBTX.mjs → chunk-SHDJA4GG.mjs} +1 -1
- package/dist/{chunk-SUKOZ6OG.js → chunk-SRAG3FST.js} +10 -6
- package/dist/{chunk-TT5WHNGS.js → chunk-YVRX3F6S.js} +149 -81
- package/dist/{chunk-2LH6PZH3.mjs → chunk-ZCH4YINE.mjs} +3 -2
- package/dist/{chunk-VGPAKLMZ.mjs → chunk-ZGIN2OAY.mjs} +12 -7
- package/dist/cli.js +2233 -158
- package/dist/cli.mjs +2238 -163
- package/dist/core.d.mts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +14 -9
- package/dist/core.mjs +10 -5
- package/dist/css-macro/postcss.js +4 -4
- package/dist/css-macro/postcss.mjs +2 -2
- package/dist/css-macro.js +5 -5
- package/dist/css-macro.mjs +2 -2
- package/dist/defaults.d.mts +1 -1
- package/dist/defaults.d.ts +1 -1
- package/dist/defaults.js +1 -1
- package/dist/defaults.mjs +1 -1
- package/dist/gulp.d.mts +1 -1
- package/dist/gulp.d.ts +1 -1
- package/dist/gulp.js +5 -5
- package/dist/gulp.mjs +4 -4
- package/dist/{index-CoXntW_P.d.mts → index-BXrmQelt.d.mts} +29 -1
- package/dist/{index-CoXntW_P.d.ts → index-BXrmQelt.d.ts} +29 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -9
- package/dist/index.mjs +7 -7
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss-html-transform.mjs +1 -1
- package/dist/presets.d.mts +8 -1
- package/dist/presets.d.ts +8 -1
- package/dist/presets.js +7 -6
- package/dist/presets.mjs +3 -2
- package/dist/reset.d.mts +1 -31
- package/dist/reset.d.ts +3 -32
- package/dist/reset.js +3 -160
- package/dist/reset.mjs +3 -160
- package/dist/types.d.mts +2 -2
- package/dist/types.d.ts +2 -2
- package/dist/types.js +1 -1
- package/dist/types.mjs +1 -1
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +6 -6
- package/dist/vite.mjs +4 -4
- package/dist/weapp-tw-css-import-rewrite-loader.js +10 -5
- package/dist/weapp-tw-runtime-classset-loader.js +9 -4
- package/dist/webpack.d.mts +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +7 -7
- package/dist/webpack.mjs +5 -5
- package/dist/webpack4.d.mts +1 -1
- package/dist/webpack4.d.ts +1 -1
- package/dist/webpack4.js +65 -56
- package/dist/webpack4.mjs +35 -26
- package/package.json +12 -7
- package/scripts/postinstall.mjs +59 -0
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunk2A4NRLSYjs = require('./chunk-2A4NRLSY.js');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkGMKSBLNYjs = require('./chunk-GMKSBLNY.js');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
var _chunkOF6MFURRjs = require('./chunk-OF6MFURR.js');
|
|
@@ -28,11 +28,12 @@ var _chunkOF6MFURRjs = require('./chunk-OF6MFURR.js');
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
var _chunkTT5WHNGSjs = require('./chunk-TT5WHNGS.js');
|
|
32
31
|
|
|
32
|
+
var _chunkYVRX3F6Sjs = require('./chunk-YVRX3F6S.js');
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
|
|
36
|
+
var _chunkNIS74SI6js = require('./chunk-NIS74SI6.js');
|
|
36
37
|
|
|
37
38
|
|
|
38
39
|
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
@@ -63,10 +64,10 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
63
64
|
const { Compilation, sources } = compiler.webpack;
|
|
64
65
|
const { ConcatSource } = sources;
|
|
65
66
|
const cssHandlerOptionsCache = /* @__PURE__ */ new Map();
|
|
66
|
-
compiler.hooks.compilation.tap(
|
|
67
|
+
compiler.hooks.compilation.tap(_chunkYVRX3F6Sjs.pluginName, (compilation) => {
|
|
67
68
|
compilation.hooks.processAssets.tapPromise(
|
|
68
69
|
{
|
|
69
|
-
name:
|
|
70
|
+
name: _chunkYVRX3F6Sjs.pluginName,
|
|
70
71
|
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
71
72
|
},
|
|
72
73
|
async (assets) => {
|
|
@@ -78,20 +79,20 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
78
79
|
compilerOptions.cache.calcHashValueChanged(chunk.id, chunk.hash);
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
|
-
const assetHashByChunk =
|
|
82
|
+
const assetHashByChunk = _chunk2A4NRLSYjs.createAssetHashByChunkMap.call(void 0, compilation.chunks);
|
|
82
83
|
const entries = Object.entries(assets);
|
|
83
84
|
const compilerOutputPath = _nullishCoalesce(_optionalChain([compilation, 'access', _ => _.compiler, 'optionalAccess', _2 => _2.outputPath]), () => ( compiler.outputPath));
|
|
84
85
|
const outputDir = compilerOutputPath ? _path2.default.resolve(compilerOutputPath) : _nullishCoalesce(_optionalChain([compilation, 'access', _3 => _3.outputOptions, 'optionalAccess', _4 => _4.path]), () => ( _process2.default.cwd()));
|
|
85
86
|
const jsAssets = /* @__PURE__ */ new Map();
|
|
86
87
|
for (const [file] of entries) {
|
|
87
88
|
if (compilerOptions.jsMatcher(file) || compilerOptions.wxsMatcher(file)) {
|
|
88
|
-
const absolute =
|
|
89
|
+
const absolute = _chunkGMKSBLNYjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
89
90
|
jsAssets.set(absolute, file);
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
const moduleGraphOptions = {
|
|
93
94
|
resolve(specifier, importer) {
|
|
94
|
-
return
|
|
95
|
+
return _chunkGMKSBLNYjs.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => jsAssets.has(candidate));
|
|
95
96
|
},
|
|
96
97
|
load: (id) => {
|
|
97
98
|
const assetName = jsAssets.get(id);
|
|
@@ -157,7 +158,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
157
158
|
const staleClassNameFallback = resolveWebpackStaleClassNameFallback(compilerOptions.staleClassNameFallback, compiler);
|
|
158
159
|
const forceRuntimeRefresh = getRuntimeRefreshRequirement();
|
|
159
160
|
debug2("processAssets ensure runtime set forceRefresh=%s major=%s", forceRuntimeRefresh, _nullishCoalesce(runtimeState.twPatcher.majorVersion, () => ( "unknown")));
|
|
160
|
-
const runtimeSet = await
|
|
161
|
+
const runtimeSet = await _chunkYVRX3F6Sjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
161
162
|
forceRefresh: forceRuntimeRefresh,
|
|
162
163
|
// webpack 的 script-only 热更新可能不会触发 runtime classset loader,
|
|
163
164
|
// 这里强制收集可避免沿用上轮 class set,保证 JS 仅按最新集合精确命中。
|
|
@@ -207,12 +208,12 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
207
208
|
const jsTaskFactories = [];
|
|
208
209
|
if (Array.isArray(groupedEntries.js)) {
|
|
209
210
|
for (const [file] of groupedEntries.js) {
|
|
210
|
-
const cacheKey =
|
|
211
|
+
const cacheKey = _chunk2A4NRLSYjs.getCacheKey.call(void 0, file);
|
|
211
212
|
const asset = compilation.getAsset(file);
|
|
212
213
|
if (!asset) {
|
|
213
214
|
continue;
|
|
214
215
|
}
|
|
215
|
-
const absoluteFile =
|
|
216
|
+
const absoluteFile = _chunkGMKSBLNYjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
216
217
|
const initialSource = asset.source.source();
|
|
217
218
|
const initialRawSource = typeof initialSource === "string" ? initialSource : initialSource.toString();
|
|
218
219
|
const chunkHash = assetHashByChunk.get(file);
|
|
@@ -233,7 +234,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
233
234
|
const currentAsset = compilation.getAsset(file);
|
|
234
235
|
const currentSourceValue = _optionalChain([currentAsset, 'optionalAccess', _5 => _5.source, 'access', _6 => _6.source, 'call', _7 => _7()]);
|
|
235
236
|
const currentSource = typeof currentSourceValue === "string" ? currentSourceValue : _nullishCoalesce(_optionalChain([currentSourceValue, 'optionalAccess', _8 => _8.toString, 'call', _9 => _9()]), () => ( ""));
|
|
236
|
-
const
|
|
237
|
+
const handlerOptions = {
|
|
237
238
|
staleClassNameFallback,
|
|
238
239
|
tailwindcssMajorVersion: runtimeState.twPatcher.majorVersion,
|
|
239
240
|
filename: absoluteFile,
|
|
@@ -241,7 +242,11 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
241
242
|
babelParserOptions: {
|
|
242
243
|
sourceFilename: absoluteFile
|
|
243
244
|
}
|
|
244
|
-
}
|
|
245
|
+
};
|
|
246
|
+
if (_chunkYVRX3F6Sjs.shouldSkipJsTransform.call(void 0, currentSource, handlerOptions)) {
|
|
247
|
+
return { result: new ConcatSource(currentSource) };
|
|
248
|
+
}
|
|
249
|
+
const { code, linked } = await compilerOptions.jsHandler(currentSource, runtimeSet, handlerOptions);
|
|
245
250
|
const source = new ConcatSource(code);
|
|
246
251
|
compilerOptions.onUpdate(file, currentSource, code);
|
|
247
252
|
debug2("js handle: %s", file);
|
|
@@ -287,7 +292,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
287
292
|
);
|
|
288
293
|
}
|
|
289
294
|
}
|
|
290
|
-
|
|
295
|
+
_chunkGMKSBLNYjs.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
|
|
291
296
|
await Promise.all(tasks);
|
|
292
297
|
debug2("end");
|
|
293
298
|
compilerOptions.onEnd();
|
|
@@ -313,9 +318,9 @@ function setupWebpackV5Loaders(options) {
|
|
|
313
318
|
getRuntimeWatchDependencies,
|
|
314
319
|
debug: debug2
|
|
315
320
|
} = options;
|
|
316
|
-
const isMpxApp =
|
|
321
|
+
const isMpxApp = _chunk2A4NRLSYjs.isMpx.call(void 0, appType);
|
|
317
322
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
318
|
-
|
|
323
|
+
_chunk2A4NRLSYjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
|
|
319
324
|
}
|
|
320
325
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
321
326
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -329,12 +334,12 @@ function setupWebpackV5Loaders(options) {
|
|
|
329
334
|
getClassSet: getClassSetInLoader,
|
|
330
335
|
getWatchDependencies: getRuntimeWatchDependencies
|
|
331
336
|
};
|
|
332
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
337
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunk2A4NRLSYjs.createLoaderAnchorFinders.call(void 0, appType);
|
|
333
338
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
334
339
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
335
340
|
} : void 0;
|
|
336
341
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
337
|
-
|
|
342
|
+
_chunk2A4NRLSYjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
338
343
|
}
|
|
339
344
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
340
345
|
loader: runtimeClassSetLoader,
|
|
@@ -354,17 +359,17 @@ function setupWebpackV5Loaders(options) {
|
|
|
354
359
|
};
|
|
355
360
|
};
|
|
356
361
|
const { NormalModule } = compiler.webpack;
|
|
357
|
-
compiler.hooks.compilation.tap(
|
|
358
|
-
NormalModule.getCompilationHooks(compilation).loader.tap(
|
|
362
|
+
compiler.hooks.compilation.tap(_chunkYVRX3F6Sjs.pluginName, (compilation) => {
|
|
363
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(_chunkYVRX3F6Sjs.pluginName, (_loaderContext, module) => {
|
|
359
364
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
360
365
|
if (!hasRuntimeLoader) {
|
|
361
366
|
return;
|
|
362
367
|
}
|
|
363
|
-
|
|
368
|
+
_chunk2A4NRLSYjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, shouldRewriteCssImports && isMpxApp);
|
|
364
369
|
const loaderEntries = module.loaders || [];
|
|
365
370
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
366
371
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
367
|
-
const isCssModule =
|
|
372
|
+
const isCssModule = _chunk2A4NRLSYjs.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
|
|
368
373
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
369
374
|
debug2("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
370
375
|
}
|
|
@@ -396,7 +401,7 @@ function setupWebpackV5Loaders(options) {
|
|
|
396
401
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
397
402
|
}
|
|
398
403
|
}
|
|
399
|
-
if (runtimeClassSetLoaderExists && !
|
|
404
|
+
if (runtimeClassSetLoaderExists && !_chunk2A4NRLSYjs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
400
405
|
const classSetLoaderEntry = createRuntimeClassSetLoaderEntry();
|
|
401
406
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
402
407
|
if (anchorIndex === -1) {
|
|
@@ -411,11 +416,11 @@ function setupWebpackV5Loaders(options) {
|
|
|
411
416
|
}
|
|
412
417
|
|
|
413
418
|
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
414
|
-
var debug =
|
|
415
|
-
var weappTailwindcssPackageDir =
|
|
419
|
+
var debug = _chunkYVRX3F6Sjs.createDebug.call(void 0, );
|
|
420
|
+
var weappTailwindcssPackageDir = _chunkGMKSBLNYjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
416
421
|
var UnifiedWebpackPluginV5 = class {
|
|
417
422
|
constructor(options = {}) {
|
|
418
|
-
this.options =
|
|
423
|
+
this.options = _chunkYVRX3F6Sjs.getCompilerContext.call(void 0, options);
|
|
419
424
|
this.appType = this.options.appType;
|
|
420
425
|
}
|
|
421
426
|
apply(compiler) {
|
|
@@ -428,22 +433,22 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
428
433
|
twPatcher: initialTwPatcher,
|
|
429
434
|
refreshTailwindcssPatcher
|
|
430
435
|
} = this.options;
|
|
431
|
-
const disabledOptions =
|
|
436
|
+
const disabledOptions = _chunkGMKSBLNYjs.resolveDisabledOptions.call(void 0, disabled);
|
|
432
437
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
433
438
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
434
|
-
const isMpxApp =
|
|
439
|
+
const isMpxApp = _chunk2A4NRLSYjs.isMpx.call(void 0, this.appType);
|
|
435
440
|
if (shouldRewriteCssImports) {
|
|
436
|
-
|
|
441
|
+
_chunk2A4NRLSYjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
437
442
|
pkgDir: weappTailwindcssPackageDir,
|
|
438
443
|
enabled: true,
|
|
439
444
|
appType: this.appType
|
|
440
445
|
});
|
|
441
|
-
|
|
446
|
+
_chunk2A4NRLSYjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
442
447
|
}
|
|
443
448
|
if (disabledOptions.plugin) {
|
|
444
449
|
return;
|
|
445
450
|
}
|
|
446
|
-
const patchRecorderState =
|
|
451
|
+
const patchRecorderState = _chunkYVRX3F6Sjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
447
452
|
source: "runtime",
|
|
448
453
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
449
454
|
});
|
|
@@ -462,7 +467,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
462
467
|
const updateRuntimeWatchDependencies = async () => {
|
|
463
468
|
runtimeWatchDependencyFiles.clear();
|
|
464
469
|
runtimeWatchDependencyContexts.clear();
|
|
465
|
-
const tailwindOptions =
|
|
470
|
+
const tailwindOptions = _chunkNIS74SI6js.resolveTailwindcssOptions.call(void 0, runtimeState.twPatcher.options);
|
|
466
471
|
if (_optionalChain([tailwindOptions, 'optionalAccess', _13 => _13.config])) {
|
|
467
472
|
runtimeWatchDependencyFiles.add(tailwindOptions.config);
|
|
468
473
|
}
|
|
@@ -501,31 +506,31 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
501
506
|
runtimeMetadataPrepared = true;
|
|
502
507
|
};
|
|
503
508
|
const syncRuntimeRefreshRequirement = () => {
|
|
504
|
-
runtimeRefreshRequiredForCompilation = runtimeRefreshRequiredForCompilation ||
|
|
509
|
+
runtimeRefreshRequiredForCompilation = runtimeRefreshRequiredForCompilation || _chunk2A4NRLSYjs.hasWatchChanges.call(void 0, compiler);
|
|
505
510
|
};
|
|
506
511
|
const resetRuntimePreparation = () => {
|
|
507
512
|
runtimeSetPrepared = false;
|
|
508
513
|
runtimeMetadataPrepared = false;
|
|
509
514
|
syncRuntimeRefreshRequirement();
|
|
510
515
|
};
|
|
511
|
-
_optionalChain([compiler, 'access', _20 => _20.hooks, 'access', _21 => _21.invalid, 'optionalAccess', _22 => _22.tap, 'optionalCall', _23 => _23(
|
|
516
|
+
_optionalChain([compiler, 'access', _20 => _20.hooks, 'access', _21 => _21.invalid, 'optionalAccess', _22 => _22.tap, 'optionalCall', _23 => _23(_chunkYVRX3F6Sjs.pluginName, () => {
|
|
512
517
|
runtimeRefreshRequiredForCompilation = true;
|
|
513
518
|
})]);
|
|
514
|
-
_optionalChain([compiler, 'access', _24 => _24.hooks, 'access', _25 => _25.watchRun, 'optionalAccess', _26 => _26.tap, 'optionalCall', _27 => _27(
|
|
519
|
+
_optionalChain([compiler, 'access', _24 => _24.hooks, 'access', _25 => _25.watchRun, 'optionalAccess', _26 => _26.tap, 'optionalCall', _27 => _27(_chunkYVRX3F6Sjs.pluginName, syncRuntimeRefreshRequirement)]);
|
|
515
520
|
if (_optionalChain([compiler, 'access', _28 => _28.hooks, 'access', _29 => _29.thisCompilation, 'optionalAccess', _30 => _30.tap])) {
|
|
516
|
-
compiler.hooks.thisCompilation.tap(
|
|
521
|
+
compiler.hooks.thisCompilation.tap(_chunkYVRX3F6Sjs.pluginName, resetRuntimePreparation);
|
|
517
522
|
} else if (_optionalChain([compiler, 'access', _31 => _31.hooks, 'access', _32 => _32.compilation, 'optionalAccess', _33 => _33.tap])) {
|
|
518
|
-
compiler.hooks.compilation.tap(
|
|
523
|
+
compiler.hooks.compilation.tap(_chunkYVRX3F6Sjs.pluginName, resetRuntimePreparation);
|
|
519
524
|
}
|
|
520
525
|
async function getClassSetInLoader() {
|
|
521
526
|
if (runtimeSetPrepared) {
|
|
522
527
|
return;
|
|
523
528
|
}
|
|
524
|
-
const signature =
|
|
529
|
+
const signature = _chunkNIS74SI6js.getRuntimeClassSetSignature.call(void 0, runtimeState.twPatcher);
|
|
525
530
|
const forceRefresh = runtimeRefreshRequiredForCompilation || signature !== runtimeSetSignature;
|
|
526
531
|
debug("runtime loader ensure class set forceRefresh=%s watchDirty=%s signatureChanged=%s", forceRefresh, runtimeRefreshRequiredForCompilation, signature !== runtimeSetSignature);
|
|
527
532
|
runtimeSetPrepared = true;
|
|
528
|
-
await
|
|
533
|
+
await _chunkYVRX3F6Sjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
529
534
|
forceRefresh,
|
|
530
535
|
forceCollect: true,
|
|
531
536
|
clearCache: forceRefresh,
|
|
@@ -7,7 +7,8 @@ var _chunkOF6MFURRjs = require('./chunk-OF6MFURR.js');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
var _chunkYVRX3F6Sjs = require('./chunk-YVRX3F6S.js');
|
|
11
12
|
|
|
12
13
|
// src/bundlers/gulp/index.ts
|
|
13
14
|
var _buffer = require('buffer');
|
|
@@ -15,12 +16,12 @@ var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
|
15
16
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
16
17
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
17
18
|
var _stream = require('stream'); var _stream2 = _interopRequireDefault(_stream);
|
|
18
|
-
var debug =
|
|
19
|
+
var debug = _chunkYVRX3F6Sjs.createDebug.call(void 0, );
|
|
19
20
|
var Transform = _stream2.default.Transform;
|
|
20
21
|
function createPlugins(options = {}) {
|
|
21
|
-
const opts =
|
|
22
|
+
const opts = _chunkYVRX3F6Sjs.getCompilerContext.call(void 0, options);
|
|
22
23
|
const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
23
|
-
const patchRecorderState =
|
|
24
|
+
const patchRecorderState = _chunkYVRX3F6Sjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
24
25
|
source: "runtime",
|
|
25
26
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
26
27
|
});
|
|
@@ -38,13 +39,13 @@ function createPlugins(options = {}) {
|
|
|
38
39
|
const MODULE_EXTENSIONS = [".js", ".mjs", ".cjs", ".ts", ".tsx", ".jsx"];
|
|
39
40
|
let runtimeSetInitialized = false;
|
|
40
41
|
async function refreshRuntimeState(force) {
|
|
41
|
-
await
|
|
42
|
+
await _chunkYVRX3F6Sjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
42
43
|
}
|
|
43
44
|
async function refreshRuntimeSet(force = false) {
|
|
44
45
|
if (!force && runtimeSetInitialized) {
|
|
45
46
|
return runtimeSet;
|
|
46
47
|
}
|
|
47
|
-
runtimeSet = await
|
|
48
|
+
runtimeSet = await _chunkYVRX3F6Sjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
48
49
|
forceRefresh: force,
|
|
49
50
|
forceCollect: force,
|
|
50
51
|
clearCache: force,
|
|
@@ -225,6 +226,9 @@ function createPlugins(options = {}) {
|
|
|
225
226
|
async transform() {
|
|
226
227
|
await runtimeState.patchPromise;
|
|
227
228
|
const currentSource = _nullishCoalesce(_optionalChain([file, 'access', _2 => _2.contents, 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]), () => ( rawSource));
|
|
229
|
+
if (_chunkYVRX3F6Sjs.shouldSkipJsTransform.call(void 0, currentSource, handlerOptions)) {
|
|
230
|
+
return { result: currentSource };
|
|
231
|
+
}
|
|
228
232
|
const { code } = await jsHandler(currentSource, runtimeSet, handlerOptions);
|
|
229
233
|
debug("js handle: %s", file.path);
|
|
230
234
|
return {
|