weapp-tailwindcss 4.11.2 → 4.12.0-alpha.1
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/dist/{chunk-WJIRXC26.js → chunk-4LBAL3RE.js} +117 -119
- package/dist/{chunk-JIERVBTX.mjs → chunk-5CF3HTTN.mjs} +1 -1
- package/dist/{chunk-OMARW5NC.mjs → chunk-AYJ4HLWZ.mjs} +4 -2
- package/dist/{chunk-VGPAKLMZ.mjs → chunk-C2E5ZLNI.mjs} +12 -7
- package/dist/{chunk-3QHYEMEW.js → chunk-CAZQZPMY.js} +45 -40
- package/dist/{chunk-AV3XB6EQ.js → chunk-CTGWJGKJ.js} +5 -5
- package/dist/{chunk-7LKMJZD2.js → chunk-GMKSBLNY.js} +2 -2
- package/dist/{chunk-EFBQ4SQR.mjs → chunk-HL3US2OT.mjs} +1 -1
- package/dist/{chunk-SUKOZ6OG.js → chunk-IUYO6NQO.js} +10 -6
- package/dist/{chunk-ZZ36BKM5.mjs → chunk-JRLWGMVZ.mjs} +6 -2
- package/dist/{chunk-QK6VNNNL.js → chunk-NIS74SI6.js} +8 -6
- package/dist/{chunk-CRDOWYG4.js → chunk-ONLKZIRQ.js} +1 -1
- package/dist/{chunk-TT5WHNGS.js → chunk-RQWWSU4U.js} +136 -77
- package/dist/{chunk-W3DXDWYC.mjs → chunk-V34LWQTS.mjs} +49 -51
- package/dist/{chunk-AB2RGZQO.mjs → chunk-ZABCOAAS.mjs} +131 -72
- package/dist/cli.js +8 -1
- package/dist/cli.mjs +8 -1
- 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 +1 -1
- package/dist/css-macro/postcss.mjs +1 -1
- package/dist/css-macro.js +1 -1
- package/dist/css-macro.mjs +1 -1
- 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/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 +41 -36
- package/dist/webpack4.mjs +12 -7
- package/package.json +8 -4
|
@@ -1192,12 +1192,14 @@ function resolveUniAppXOptions(option) {
|
|
|
1192
1192
|
if (typeof option === "object" && option) {
|
|
1193
1193
|
return {
|
|
1194
1194
|
enabled: option.enabled !== false,
|
|
1195
|
-
componentLocalStyles: resolveComponentLocalStyles(option)
|
|
1195
|
+
componentLocalStyles: resolveComponentLocalStyles(option),
|
|
1196
|
+
uvueUnsupported: option.uvueUnsupported ?? "warn"
|
|
1196
1197
|
};
|
|
1197
1198
|
}
|
|
1198
1199
|
return {
|
|
1199
1200
|
enabled: Boolean(option),
|
|
1200
|
-
componentLocalStyles: resolveComponentLocalStyles(option)
|
|
1201
|
+
componentLocalStyles: resolveComponentLocalStyles(option),
|
|
1202
|
+
uvueUnsupported: "warn"
|
|
1201
1203
|
};
|
|
1202
1204
|
}
|
|
1203
1205
|
function isUniAppXEnabled(option) {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
isMpx,
|
|
12
12
|
patchMpxLoaderResolve,
|
|
13
13
|
setupMpxTailwindcssRedirect
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-5CF3HTTN.mjs";
|
|
15
15
|
import {
|
|
16
16
|
pushConcurrentTaskFactories,
|
|
17
17
|
resolveDisabledOptions,
|
|
@@ -27,18 +27,19 @@ import {
|
|
|
27
27
|
ensureRuntimeClassSet,
|
|
28
28
|
getCompilerContext,
|
|
29
29
|
pluginName,
|
|
30
|
-
setupPatchRecorder
|
|
31
|
-
|
|
30
|
+
setupPatchRecorder,
|
|
31
|
+
shouldSkipJsTransform
|
|
32
|
+
} from "./chunk-ZABCOAAS.mjs";
|
|
32
33
|
import {
|
|
33
34
|
getRuntimeClassSetSignature,
|
|
34
35
|
resolveTailwindcssOptions
|
|
35
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-AYJ4HLWZ.mjs";
|
|
36
37
|
import {
|
|
37
38
|
getGroupedEntries
|
|
38
39
|
} from "./chunk-OOHJLO5M.mjs";
|
|
39
40
|
import {
|
|
40
41
|
__dirname
|
|
41
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-HL3US2OT.mjs";
|
|
42
43
|
|
|
43
44
|
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
44
45
|
import process3 from "process";
|
|
@@ -236,7 +237,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
236
237
|
const currentAsset = compilation.getAsset(file);
|
|
237
238
|
const currentSourceValue = currentAsset?.source.source();
|
|
238
239
|
const currentSource = typeof currentSourceValue === "string" ? currentSourceValue : currentSourceValue?.toString() ?? "";
|
|
239
|
-
const
|
|
240
|
+
const handlerOptions = {
|
|
240
241
|
staleClassNameFallback,
|
|
241
242
|
tailwindcssMajorVersion: runtimeState.twPatcher.majorVersion,
|
|
242
243
|
filename: absoluteFile,
|
|
@@ -244,7 +245,11 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
244
245
|
babelParserOptions: {
|
|
245
246
|
sourceFilename: absoluteFile
|
|
246
247
|
}
|
|
247
|
-
}
|
|
248
|
+
};
|
|
249
|
+
if (shouldSkipJsTransform(currentSource, handlerOptions)) {
|
|
250
|
+
return { result: new ConcatSource(currentSource) };
|
|
251
|
+
}
|
|
252
|
+
const { code, linked } = await compilerOptions.jsHandler(currentSource, runtimeSet, handlerOptions);
|
|
248
253
|
const source = new ConcatSource(code);
|
|
249
254
|
compilerOptions.onUpdate(file, currentSource, code);
|
|
250
255
|
debug2("js handle: %s", file);
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkCTGWJGKJjs = require('./chunk-CTGWJGKJ.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 _chunkRQWWSU4Ujs = require('./chunk-RQWWSU4U.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(_chunkRQWWSU4Ujs.pluginName, (compilation) => {
|
|
67
68
|
compilation.hooks.processAssets.tapPromise(
|
|
68
69
|
{
|
|
69
|
-
name:
|
|
70
|
+
name: _chunkRQWWSU4Ujs.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 = _chunkCTGWJGKJjs.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 _chunkRQWWSU4Ujs.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 = _chunkCTGWJGKJjs.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 (_chunkRQWWSU4Ujs.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 = _chunkCTGWJGKJjs.isMpx.call(void 0, appType);
|
|
317
322
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
318
|
-
|
|
323
|
+
_chunkCTGWJGKJjs.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 } = _chunkCTGWJGKJjs.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
|
+
_chunkCTGWJGKJjs.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(_chunkRQWWSU4Ujs.pluginName, (compilation) => {
|
|
363
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(_chunkRQWWSU4Ujs.pluginName, (_loaderContext, module) => {
|
|
359
364
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
360
365
|
if (!hasRuntimeLoader) {
|
|
361
366
|
return;
|
|
362
367
|
}
|
|
363
|
-
|
|
368
|
+
_chunkCTGWJGKJjs.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 = _chunkCTGWJGKJjs.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 && !_chunkCTGWJGKJjs.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 = _chunkRQWWSU4Ujs.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 = _chunkRQWWSU4Ujs.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 = _chunkCTGWJGKJjs.isMpx.call(void 0, this.appType);
|
|
435
440
|
if (shouldRewriteCssImports) {
|
|
436
|
-
|
|
441
|
+
_chunkCTGWJGKJjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
437
442
|
pkgDir: weappTailwindcssPackageDir,
|
|
438
443
|
enabled: true,
|
|
439
444
|
appType: this.appType
|
|
440
445
|
});
|
|
441
|
-
|
|
446
|
+
_chunkCTGWJGKJjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
442
447
|
}
|
|
443
448
|
if (disabledOptions.plugin) {
|
|
444
449
|
return;
|
|
445
450
|
}
|
|
446
|
-
const patchRecorderState =
|
|
451
|
+
const patchRecorderState = _chunkRQWWSU4Ujs.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 || _chunkCTGWJGKJjs.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(_chunkRQWWSU4Ujs.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(_chunkRQWWSU4Ujs.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(_chunkRQWWSU4Ujs.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(_chunkRQWWSU4Ujs.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 _chunkRQWWSU4Ujs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
529
534
|
forceRefresh,
|
|
530
535
|
forceCollect: true,
|
|
531
536
|
clearCache: forceRefresh,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkGMKSBLNYjs = require('./chunk-GMKSBLNY.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkRQWWSU4Ujs = require('./chunk-RQWWSU4U.js');
|
|
7
7
|
|
|
8
8
|
// src/shared/mpx.ts
|
|
9
9
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
@@ -145,7 +145,7 @@ function rewriteTailwindcssRequestForCss(data, pkgDir, appType) {
|
|
|
145
145
|
if (!CSS_EXT_RE2.test(normalizedIssuer)) {
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
|
-
const resolved =
|
|
148
|
+
const resolved = _chunkGMKSBLNYjs.resolveTailwindcssImport.call(void 0, request, pkgDir, { appType });
|
|
149
149
|
if (!resolved) {
|
|
150
150
|
return;
|
|
151
151
|
}
|
|
@@ -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(_chunkRQWWSU4Ujs.pluginName, (factory) => {
|
|
159
|
+
factory.hooks.beforeResolve.tap(_chunkRQWWSU4Ujs.pluginName, (data) => {
|
|
160
160
|
rewriteTailwindcssRequestForCss(data, options.pkgDir, options.appType);
|
|
161
161
|
});
|
|
162
162
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkONLKZIRQjs = require('./chunk-ONLKZIRQ.js');
|
|
4
4
|
|
|
5
5
|
// src/utils/disabled.ts
|
|
6
6
|
function resolveDisabledOptions(disabled) {
|
|
@@ -19,7 +19,7 @@ function resolveDisabledOptions(disabled) {
|
|
|
19
19
|
// src/utils/resolve-package.ts
|
|
20
20
|
var _module = require('module');
|
|
21
21
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
22
|
-
var require2 = _module.createRequire.call(void 0,
|
|
22
|
+
var require2 = _module.createRequire.call(void 0, _chunkONLKZIRQjs.importMetaUrl);
|
|
23
23
|
function resolvePackageDir(name) {
|
|
24
24
|
const pkgPath = require2.resolve(`${name}/package.json`);
|
|
25
25
|
return _path2.default.dirname(pkgPath);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@24.12.
|
|
1
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@24.12.2__@swc+core@1.15.32_@swc+_5ed6cbcda668e45f9f2d3d9f21b34c59/node_modules/tsup/assets/esm_shims.js
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { fileURLToPath } from "url";
|
|
4
4
|
var getFilename = () => fileURLToPath(import.meta.url);
|
|
@@ -7,7 +7,8 @@ var _chunkOF6MFURRjs = require('./chunk-OF6MFURR.js');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
var _chunkRQWWSU4Ujs = require('./chunk-RQWWSU4U.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 = _chunkRQWWSU4Ujs.createDebug.call(void 0, );
|
|
19
20
|
var Transform = _stream2.default.Transform;
|
|
20
21
|
function createPlugins(options = {}) {
|
|
21
|
-
const opts =
|
|
22
|
+
const opts = _chunkRQWWSU4Ujs.getCompilerContext.call(void 0, options);
|
|
22
23
|
const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
23
|
-
const patchRecorderState =
|
|
24
|
+
const patchRecorderState = _chunkRQWWSU4Ujs.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 _chunkRQWWSU4Ujs.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 _chunkRQWWSU4Ujs.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 (_chunkRQWWSU4Ujs.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 {
|
|
@@ -6,8 +6,9 @@ import {
|
|
|
6
6
|
ensureRuntimeClassSet,
|
|
7
7
|
getCompilerContext,
|
|
8
8
|
refreshTailwindRuntimeState,
|
|
9
|
-
setupPatchRecorder
|
|
10
|
-
|
|
9
|
+
setupPatchRecorder,
|
|
10
|
+
shouldSkipJsTransform
|
|
11
|
+
} from "./chunk-ZABCOAAS.mjs";
|
|
11
12
|
|
|
12
13
|
// src/bundlers/gulp/index.ts
|
|
13
14
|
import { Buffer } from "buffer";
|
|
@@ -225,6 +226,9 @@ function createPlugins(options = {}) {
|
|
|
225
226
|
async transform() {
|
|
226
227
|
await runtimeState.patchPromise;
|
|
227
228
|
const currentSource = file.contents?.toString() ?? rawSource;
|
|
229
|
+
if (shouldSkipJsTransform(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 {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkONLKZIRQjs = require('./chunk-ONLKZIRQ.js');
|
|
7
7
|
|
|
8
8
|
// src/tailwindcss/patcher-options.ts
|
|
9
9
|
function resolveTailwindcssOptions(options) {
|
|
@@ -532,7 +532,7 @@ function resolveModuleFromPaths(specifier, paths) {
|
|
|
532
532
|
return void 0;
|
|
533
533
|
}
|
|
534
534
|
try {
|
|
535
|
-
const req = _module.createRequire.call(void 0,
|
|
535
|
+
const req = _module.createRequire.call(void 0, _chunkONLKZIRQjs.importMetaUrl);
|
|
536
536
|
return req.resolve(specifier, { paths });
|
|
537
537
|
} catch (e4) {
|
|
538
538
|
return void 0;
|
|
@@ -587,11 +587,11 @@ function createDefaultResolvePaths(basedir) {
|
|
|
587
587
|
const cwd = _process2.default.cwd();
|
|
588
588
|
appendNodeModules(paths, cwd);
|
|
589
589
|
try {
|
|
590
|
-
const modulePath = _url.fileURLToPath.call(void 0,
|
|
590
|
+
const modulePath = _url.fileURLToPath.call(void 0, _chunkONLKZIRQjs.importMetaUrl);
|
|
591
591
|
const candidate = _fs.existsSync.call(void 0, modulePath) && !_path2.default.extname(modulePath) ? modulePath : _path2.default.dirname(modulePath);
|
|
592
592
|
paths.add(candidate);
|
|
593
593
|
} catch (e5) {
|
|
594
|
-
paths.add(
|
|
594
|
+
paths.add(_chunkONLKZIRQjs.importMetaUrl);
|
|
595
595
|
}
|
|
596
596
|
if (paths.size === 0) {
|
|
597
597
|
fallbackCandidates = fallbackCandidates.filter(Boolean);
|
|
@@ -1195,12 +1195,14 @@ function resolveUniAppXOptions(option) {
|
|
|
1195
1195
|
if (typeof option === "object" && option) {
|
|
1196
1196
|
return {
|
|
1197
1197
|
enabled: option.enabled !== false,
|
|
1198
|
-
componentLocalStyles: resolveComponentLocalStyles(option)
|
|
1198
|
+
componentLocalStyles: resolveComponentLocalStyles(option),
|
|
1199
|
+
uvueUnsupported: _nullishCoalesce(option.uvueUnsupported, () => ( "warn"))
|
|
1199
1200
|
};
|
|
1200
1201
|
}
|
|
1201
1202
|
return {
|
|
1202
1203
|
enabled: Boolean(option),
|
|
1203
|
-
componentLocalStyles: resolveComponentLocalStyles(option)
|
|
1204
|
+
componentLocalStyles: resolveComponentLocalStyles(option),
|
|
1205
|
+
uvueUnsupported: "warn"
|
|
1204
1206
|
};
|
|
1205
1207
|
}
|
|
1206
1208
|
function isUniAppXEnabled(option) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@24.12.
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@24.12.2__@swc+core@1.15.32_@swc+_5ed6cbcda668e45f9f2d3d9f21b34c59/node_modules/tsup/assets/cjs_shims.js
|
|
2
2
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
3
3
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
4
4
|
|