weapp-tailwindcss 4.9.8 → 4.9.9-beta.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.
@@ -3,7 +3,7 @@
3
3
  var _chunkDOX3RXJ2js = require('./chunk-DOX3RXJ2.js');
4
4
 
5
5
 
6
- var _chunkEAD4D7DFjs = require('./chunk-EAD4D7DF.js');
6
+ var _chunkYY55J7K3js = require('./chunk-YY55J7K3.js');
7
7
 
8
8
  // src/shared/mpx.ts
9
9
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
@@ -154,8 +154,8 @@ function applyTailwindcssCssImportRewrite(compiler, options) {
154
154
  if (!options.enabled) {
155
155
  return;
156
156
  }
157
- compiler.hooks.normalModuleFactory.tap(_chunkEAD4D7DFjs.pluginName, (factory) => {
158
- factory.hooks.beforeResolve.tap(_chunkEAD4D7DFjs.pluginName, (data) => {
157
+ compiler.hooks.normalModuleFactory.tap(_chunkYY55J7K3js.pluginName, (factory) => {
158
+ factory.hooks.beforeResolve.tap(_chunkYY55J7K3js.pluginName, (data) => {
159
159
  rewriteTailwindcssRequestForCss(data, options.pkgDir, options.appType);
160
160
  });
161
161
  });
@@ -1,14 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
- var _chunkEAD4D7DFjs = require('./chunk-EAD4D7DF.js');
4
+ var _chunkYY55J7K3js = require('./chunk-YY55J7K3.js');
5
5
 
6
6
 
7
7
  var _chunkPO3CCFU7js = require('./chunk-PO3CCFU7.js');
8
8
 
9
9
  // src/tailwindcss/recorder.ts
10
10
  function setupPatchRecorder(patcher, baseDir, options) {
11
- const recorder = _chunkEAD4D7DFjs.createPatchTargetRecorder.call(void 0, baseDir, patcher, options);
11
+ const recorder = _chunkYY55J7K3js.createPatchTargetRecorder.call(void 0, baseDir, patcher, options);
12
12
  if (_optionalChain([recorder, 'optionalAccess', _ => _.message]) && _optionalChain([options, 'optionalAccess', _2 => _2.logMessage]) !== false) {
13
13
  const prefix = _optionalChain([options, 'optionalAccess', _3 => _3.messagePrefix]) ? `${options.messagePrefix} ` : "";
14
14
  _chunkPO3CCFU7js.logger.info("%s%s", prefix, recorder.message);
@@ -16,7 +16,7 @@ function setupPatchRecorder(patcher, baseDir, options) {
16
16
  const onPatchCompleted = _optionalChain([recorder, 'optionalAccess', _4 => _4.onPatched]) ? async () => {
17
17
  await recorder.onPatched();
18
18
  } : void 0;
19
- const patchPromise = patcher ? _chunkEAD4D7DFjs.createTailwindPatchPromise.call(void 0, patcher, onPatchCompleted) : Promise.resolve();
19
+ const patchPromise = patcher ? _chunkYY55J7K3js.createTailwindPatchPromise.call(void 0, patcher, onPatchCompleted) : Promise.resolve();
20
20
  return {
21
21
  recorder,
22
22
  patchPromise,
@@ -9,7 +9,7 @@
9
9
 
10
10
 
11
11
 
12
- var _chunkOW5UKXZUjs = require('./chunk-OW5UKXZU.js');
12
+ var _chunk42HSNAKMjs = require('./chunk-42HSNAKM.js');
13
13
 
14
14
 
15
15
 
@@ -22,14 +22,14 @@ var _chunkDOX3RXJ2js = require('./chunk-DOX3RXJ2.js');
22
22
  var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
23
23
 
24
24
 
25
- var _chunkBJWGT5ODjs = require('./chunk-BJWGT5OD.js');
25
+ var _chunkA2ST4H4Yjs = require('./chunk-A2ST4H4Y.js');
26
26
 
27
27
 
28
28
 
29
29
 
30
30
 
31
31
 
32
- var _chunkEAD4D7DFjs = require('./chunk-EAD4D7DF.js');
32
+ var _chunkYY55J7K3js = require('./chunk-YY55J7K3.js');
33
33
 
34
34
 
35
35
  var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
@@ -51,10 +51,10 @@ function setupWebpackV5ProcessAssetsHook(options) {
51
51
  } = options;
52
52
  const { Compilation, sources } = compiler.webpack;
53
53
  const { ConcatSource } = sources;
54
- compiler.hooks.compilation.tap(_chunkEAD4D7DFjs.pluginName, (compilation) => {
54
+ compiler.hooks.compilation.tap(_chunkYY55J7K3js.pluginName, (compilation) => {
55
55
  compilation.hooks.processAssets.tapPromise(
56
56
  {
57
- name: _chunkEAD4D7DFjs.pluginName,
57
+ name: _chunkYY55J7K3js.pluginName,
58
58
  stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
59
59
  },
60
60
  async (assets) => {
@@ -123,7 +123,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
123
123
  const groupedEntries = _chunkDYLQ6UOIjs.getGroupedEntries.call(void 0, entries, compilerOptions);
124
124
  await refreshRuntimeState(true);
125
125
  await runtimeState.patchPromise;
126
- const runtimeSet = await _chunkEAD4D7DFjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
126
+ const runtimeSet = await _chunkYY55J7K3js.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
127
127
  debug2("get runtimeSet, class count: %d", runtimeSet.size);
128
128
  const tasks = [];
129
129
  if (Array.isArray(groupedEntries.html)) {
@@ -160,7 +160,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
160
160
  const jsTaskFactories = [];
161
161
  if (Array.isArray(groupedEntries.js)) {
162
162
  for (const [file] of groupedEntries.js) {
163
- const cacheKey = _chunkOW5UKXZUjs.getCacheKey.call(void 0, file);
163
+ const cacheKey = _chunk42HSNAKMjs.getCacheKey.call(void 0, file);
164
164
  const asset = compilation.getAsset(file);
165
165
  if (!asset) {
166
166
  continue;
@@ -265,9 +265,9 @@ function setupWebpackV5Loaders(options) {
265
265
  getClassSetInLoader,
266
266
  debug: debug2
267
267
  } = options;
268
- const isMpxApp = _chunkOW5UKXZUjs.isMpx.call(void 0, appType);
268
+ const isMpxApp = _chunk42HSNAKMjs.isMpx.call(void 0, appType);
269
269
  if (shouldRewriteCssImports && isMpxApp) {
270
- _chunkOW5UKXZUjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
270
+ _chunk42HSNAKMjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
271
271
  }
272
272
  const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
273
273
  const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
@@ -280,12 +280,12 @@ function setupWebpackV5Loaders(options) {
280
280
  const classSetLoaderOptions = {
281
281
  getClassSet: getClassSetInLoader
282
282
  };
283
- const { findRewriteAnchor, findClassSetAnchor } = _chunkOW5UKXZUjs.createLoaderAnchorFinders.call(void 0, appType);
283
+ const { findRewriteAnchor, findClassSetAnchor } = _chunk42HSNAKMjs.createLoaderAnchorFinders.call(void 0, appType);
284
284
  const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
285
285
  rewriteCssImports: runtimeLoaderRewriteOptions
286
286
  } : void 0;
287
287
  if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
288
- _chunkOW5UKXZUjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
288
+ _chunk42HSNAKMjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
289
289
  }
290
290
  const createRuntimeClassSetLoaderEntry = () => ({
291
291
  loader: runtimeClassSetLoader,
@@ -305,17 +305,17 @@ function setupWebpackV5Loaders(options) {
305
305
  };
306
306
  };
307
307
  const { NormalModule } = compiler.webpack;
308
- compiler.hooks.compilation.tap(_chunkEAD4D7DFjs.pluginName, (compilation) => {
309
- NormalModule.getCompilationHooks(compilation).loader.tap(_chunkEAD4D7DFjs.pluginName, (_loaderContext, module) => {
308
+ compiler.hooks.compilation.tap(_chunkYY55J7K3js.pluginName, (compilation) => {
309
+ NormalModule.getCompilationHooks(compilation).loader.tap(_chunkYY55J7K3js.pluginName, (_loaderContext, module) => {
310
310
  const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
311
311
  if (!hasRuntimeLoader) {
312
312
  return;
313
313
  }
314
- _chunkOW5UKXZUjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, shouldRewriteCssImports && isMpxApp);
314
+ _chunk42HSNAKMjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, shouldRewriteCssImports && isMpxApp);
315
315
  const loaderEntries = module.loaders || [];
316
316
  let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
317
317
  const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
318
- const isCssModule = _chunkOW5UKXZUjs.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
318
+ const isCssModule = _chunk42HSNAKMjs.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
319
319
  if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
320
320
  debug2("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
321
321
  }
@@ -347,7 +347,7 @@ function setupWebpackV5Loaders(options) {
347
347
  rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
348
348
  }
349
349
  }
350
- if (runtimeClassSetLoaderExists && !_chunkOW5UKXZUjs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
350
+ if (runtimeClassSetLoaderExists && !_chunk42HSNAKMjs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
351
351
  const classSetLoaderEntry = createRuntimeClassSetLoaderEntry();
352
352
  const anchorIndex = findClassSetAnchor(loaderEntries);
353
353
  if (anchorIndex === -1) {
@@ -362,11 +362,11 @@ function setupWebpackV5Loaders(options) {
362
362
  }
363
363
 
364
364
  // src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
365
- var debug = _chunkEAD4D7DFjs.createDebug.call(void 0, );
365
+ var debug = _chunkYY55J7K3js.createDebug.call(void 0, );
366
366
  var weappTailwindcssPackageDir = _chunkDOX3RXJ2js.resolvePackageDir.call(void 0, "weapp-tailwindcss");
367
367
  var UnifiedWebpackPluginV5 = class {
368
368
  constructor(options = {}) {
369
- this.options = _chunkEAD4D7DFjs.getCompilerContext.call(void 0, options);
369
+ this.options = _chunkYY55J7K3js.getCompilerContext.call(void 0, options);
370
370
  this.appType = this.options.appType;
371
371
  }
372
372
  apply(compiler) {
@@ -382,19 +382,19 @@ var UnifiedWebpackPluginV5 = class {
382
382
  const disabledOptions = _chunkDOX3RXJ2js.resolveDisabledOptions.call(void 0, disabled);
383
383
  const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
384
384
  const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
385
- const isMpxApp = _chunkOW5UKXZUjs.isMpx.call(void 0, this.appType);
385
+ const isMpxApp = _chunk42HSNAKMjs.isMpx.call(void 0, this.appType);
386
386
  if (shouldRewriteCssImports) {
387
- _chunkOW5UKXZUjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
387
+ _chunk42HSNAKMjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
388
388
  pkgDir: weappTailwindcssPackageDir,
389
389
  enabled: true,
390
390
  appType: this.appType
391
391
  });
392
- _chunkOW5UKXZUjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
392
+ _chunk42HSNAKMjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
393
393
  }
394
394
  if (disabledOptions.plugin) {
395
395
  return;
396
396
  }
397
- const patchRecorderState = _chunkBJWGT5ODjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
397
+ const patchRecorderState = _chunkA2ST4H4Yjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
398
398
  source: "runtime",
399
399
  cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
400
400
  });
@@ -405,12 +405,12 @@ var UnifiedWebpackPluginV5 = class {
405
405
  onPatchCompleted: patchRecorderState.onPatchCompleted
406
406
  };
407
407
  const refreshRuntimeState = async (force) => {
408
- await _chunkEAD4D7DFjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
408
+ await _chunkYY55J7K3js.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
409
409
  };
410
410
  async function getClassSetInLoader() {
411
411
  await refreshRuntimeState(true);
412
412
  await runtimeState.patchPromise;
413
- await _chunkEAD4D7DFjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
413
+ await _chunkYY55J7K3js.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
414
414
  }
415
415
  onLoad();
416
416
  setupWebpackV5Loaders({