weapp-tailwindcss 4.12.0 → 5.0.0-next.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/dist/babel/index.d.ts +3 -0
- package/dist/bundlers/gulp/index.d.ts +7 -0
- package/dist/bundlers/shared/cache.d.ts +16 -0
- package/dist/bundlers/shared/css-cleanup.d.ts +4 -0
- package/dist/bundlers/shared/css-imports.d.ts +8 -0
- package/dist/bundlers/shared/generator-candidates.d.ts +5 -0
- package/dist/bundlers/shared/generator-css.d.ts +41 -0
- package/dist/bundlers/shared/module-graph.d.ts +5 -0
- package/dist/bundlers/shared/run-tasks.d.ts +2 -0
- package/dist/bundlers/vite/bundle-entries.d.ts +14 -0
- package/dist/bundlers/vite/bundle-state.d.ts +43 -0
- package/dist/bundlers/vite/css-finalizer.d.ts +19 -0
- package/dist/bundlers/vite/generate-bundle.d.ts +20 -0
- package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +21 -0
- package/dist/bundlers/vite/index.d.ts +3 -0
- package/dist/bundlers/vite/js-precheck.d.ts +1 -0
- package/dist/bundlers/vite/query.d.ts +15 -0
- package/dist/bundlers/vite/resolve-app-type.d.ts +2 -0
- package/dist/bundlers/vite/rewrite-css-imports.d.ts +11 -0
- package/dist/bundlers/vite/runtime-affecting-signature.d.ts +2 -0
- package/dist/bundlers/vite/utils.d.ts +9 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +20 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-assets.d.ts +14 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-loaders.d.ts +15 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v4.d.ts +9 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +17 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +19 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +9 -0
- package/dist/bundlers/webpack/index.d.ts +1 -0
- package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +12 -0
- package/dist/bundlers/webpack/loaders/weapp-tw-runtime-classset-loader.d.ts +11 -0
- package/dist/bundlers/webpack/shared/css-imports.d.ts +6 -0
- package/dist/bundlers/webpack/shared/loader-anchors.d.ts +8 -0
- package/dist/cache/index.d.ts +38 -0
- package/dist/cache/md5.d.ts +1 -0
- package/dist/chunk-8l464Juk.js +28 -0
- package/dist/cli/config.d.ts +5 -0
- package/dist/cli/context.d.ts +16 -0
- package/dist/cli/doctor/constants.d.ts +7 -0
- package/dist/cli/doctor/types.d.ts +31 -0
- package/dist/cli/doctor.d.ts +4 -0
- package/dist/cli/helpers/options/format.d.ts +2 -0
- package/dist/cli/helpers/options/parse.d.ts +3 -0
- package/dist/cli/helpers/options/resolve.d.ts +1 -0
- package/dist/cli/helpers/options.d.ts +3 -0
- package/dist/cli/helpers/patch-cwd.d.ts +1 -0
- package/dist/cli/helpers.d.ts +5 -0
- package/dist/cli/mount-options/patch-status.d.ts +2 -0
- package/dist/cli/mount-options.d.ts +2 -0
- package/dist/cli/patch-options.d.ts +6 -0
- package/dist/cli/tokens.d.ts +4 -0
- package/dist/cli/types.d.ts +17 -0
- package/dist/cli/vscode-entry.d.ts +14 -0
- package/dist/cli/workspace/package-dirs.d.ts +3 -0
- package/dist/cli/workspace/patch-package.d.ts +3 -0
- package/dist/cli/workspace/patch-utils.d.ts +3 -0
- package/dist/cli/workspace/types.d.ts +11 -0
- package/dist/cli/workspace/workspace-globs.d.ts +2 -0
- package/dist/cli/workspace/workspace-io.d.ts +1 -0
- package/dist/cli/workspace/workspace-lock.d.ts +1 -0
- package/dist/cli/workspace.d.ts +2 -0
- package/dist/cli.d.ts +1 -2
- package/dist/cli.js +2425 -3524
- package/dist/cli.mjs +2402 -3505
- package/dist/constants-B-_T5UnW.mjs +44 -0
- package/dist/constants-p1dyh1x1.js +73 -0
- package/dist/constants.d.ts +13 -0
- package/dist/context/compiler-context-cache.d.ts +3 -0
- package/dist/context/custom-attributes.d.ts +2 -0
- package/dist/context/handlers.d.ts +6 -0
- package/dist/context/index.d.ts +7 -0
- package/dist/context/logger.d.ts +4 -0
- package/dist/context/tailwindcss/basedir.d.ts +1 -0
- package/dist/context/tailwindcss/rax.d.ts +2 -0
- package/dist/context/tailwindcss.d.ts +4 -0
- package/dist/context/workspace.d.ts +3 -0
- package/dist/core.d.ts +5 -21
- package/dist/core.js +138 -180
- package/dist/core.mjs +135 -180
- package/dist/css-imports-BbrbluP9.js +177 -0
- package/dist/css-imports-CSdPq_Sc.mjs +128 -0
- package/dist/css-macro/constants.d.ts +14 -0
- package/dist/css-macro/index.d.ts +15 -0
- package/dist/css-macro/postcss.d.ts +3 -7
- package/dist/css-macro/postcss.js +44 -58
- package/dist/css-macro/postcss.mjs +44 -56
- package/dist/css-macro.d.ts +1 -20
- package/dist/css-macro.js +37 -50
- package/dist/css-macro.mjs +33 -47
- package/dist/debug/index.d.ts +5 -0
- package/dist/defaults.d.ts +2 -11
- package/dist/defaults.js +132 -8
- package/dist/defaults.mjs +128 -7
- package/dist/escape.js +31 -54
- package/dist/escape.mjs +18 -25
- package/dist/experimental/index.d.ts +2 -0
- package/dist/experimental/oxc/ast-utils.d.ts +30 -0
- package/dist/experimental/oxc/index.d.ts +2 -0
- package/dist/experimental/oxc/module-specifiers.d.ts +2 -0
- package/dist/experimental/shared/cache.d.ts +3 -0
- package/dist/experimental/shared/transform.d.ts +3 -0
- package/dist/experimental/shared.d.ts +8 -0
- package/dist/experimental/swc/ast-utils.d.ts +30 -0
- package/dist/experimental/swc/index.d.ts +2 -0
- package/dist/experimental/swc/module-specifiers.d.ts +2 -0
- package/dist/generator/index.d.ts +11 -0
- package/dist/generator/options.d.ts +15 -0
- package/dist/generator/types.d.ts +19 -0
- package/dist/generator-CZ-JXw6T.js +492 -0
- package/dist/generator-Dwxgra97.mjs +399 -0
- package/dist/generator-css-CnYjiMrD.js +1084 -0
- package/dist/generator-css-DhPFjSzK.mjs +1057 -0
- package/dist/generator.d.ts +1 -0
- package/dist/generator.js +19 -0
- package/dist/generator.mjs +2 -0
- package/dist/gulp.d.ts +4 -24
- package/dist/gulp.js +271 -13
- package/dist/gulp.mjs +263 -13
- package/dist/index.d.ts +8 -15
- package/dist/index.js +12 -24
- package/dist/index.mjs +6 -24
- package/dist/js/JsTokenUpdater.d.ts +14 -0
- package/dist/js/ModuleGraph.d.ts +18 -0
- package/dist/js/NodePathWalker.d.ts +33 -0
- package/dist/js/babel/parse.d.ts +9 -0
- package/dist/js/babel/process.d.ts +4 -0
- package/dist/js/babel.d.ts +13 -0
- package/dist/js/class-context.d.ts +3 -0
- package/dist/js/evalTransforms.d.ts +7 -0
- package/dist/js/handlers.d.ts +5 -0
- package/dist/js/index.d.ts +4 -0
- package/dist/js/module-graph/ignored-exports.d.ts +18 -0
- package/dist/js/module-graph/types.d.ts +17 -0
- package/dist/js/node-path-walker/export-handlers.d.ts +12 -0
- package/dist/js/node-path-walker/import-tokens.d.ts +24 -0
- package/dist/js/precheck.d.ts +2 -0
- package/dist/js/sourceAnalysis.d.ts +17 -0
- package/dist/js/syntax.d.ts +10 -0
- package/dist/js/taggedTemplateIgnore.d.ts +13 -0
- package/dist/js/types.d.ts +11 -0
- package/dist/lightningcss/index.d.ts +8 -0
- package/dist/lightningcss/style-handler/options.d.ts +3 -0
- package/dist/lightningcss/style-handler/selector-transform.d.ts +10 -0
- package/dist/lightningcss/style-handler/selector-utils.d.ts +10 -0
- package/dist/lightningcss/style-handler.d.ts +17 -0
- package/dist/loader-anchors-DvwgIYdA.mjs +205 -0
- package/dist/loader-anchors-cprm4Klq.js +273 -0
- package/dist/logger/index.d.ts +2 -0
- package/dist/logger-BZ45DZJT.js +1003 -0
- package/dist/logger-BoVx1Dbt.mjs +935 -0
- package/dist/patcher-options-6gJN2EXy.js +115 -0
- package/dist/patcher-options-DQfR5xxT.mjs +92 -0
- package/dist/postcss-html-transform.d.ts +3 -3
- package/dist/postcss-html-transform.js +7 -10
- package/dist/postcss-html-transform.mjs +3 -6
- package/dist/postcss.d.ts +15 -0
- package/dist/postcss.js +278 -0
- package/dist/postcss.mjs +268 -0
- package/dist/presets/hbuilderx.d.ts +4 -0
- package/dist/presets/index.d.ts +3 -0
- package/dist/presets/shared.d.ts +10 -0
- package/dist/presets/taro.d.ts +4 -0
- package/dist/presets/uni-app-x.d.ts +16 -0
- package/dist/presets/uni-app.d.ts +4 -0
- package/dist/presets.d.ts +1 -76
- package/dist/presets.js +115 -163
- package/dist/presets.mjs +107 -163
- package/dist/recorder-B_XyZ576.mjs +2763 -0
- package/dist/recorder-rn_2v_nd.js +2878 -0
- package/dist/reset/index.d.ts +2 -0
- package/dist/reset.d.ts +1 -4
- package/dist/reset.js +19 -8
- package/dist/reset.mjs +2 -8
- package/dist/shared/classname-transform.d.ts +14 -0
- package/dist/shared/mpx.d.ts +7 -0
- package/dist/shared/tailwindcss-css-redirect.d.ts +1 -0
- package/dist/tailwindcss/index.d.ts +11 -0
- package/dist/tailwindcss/miniprogram.d.ts +1 -0
- package/dist/tailwindcss/patcher-options.d.ts +56 -0
- package/dist/tailwindcss/patcher-resolve.d.ts +4 -0
- package/dist/tailwindcss/patcher.d.ts +13 -0
- package/dist/tailwindcss/recorder.d.ts +13 -0
- package/dist/tailwindcss/remove-unsupported-css.d.ts +2 -0
- package/dist/tailwindcss/runtime/cache.d.ts +11 -0
- package/dist/tailwindcss/runtime-logs.d.ts +3 -0
- package/dist/tailwindcss/runtime.d.ts +29 -0
- package/dist/tailwindcss/targets/paths.d.ts +13 -0
- package/dist/tailwindcss/targets/record-io.d.ts +5 -0
- package/dist/tailwindcss/targets/recorder.d.ts +3 -0
- package/dist/tailwindcss/targets/types.d.ts +35 -0
- package/dist/tailwindcss/targets.d.ts +6 -0
- package/dist/tailwindcss/v3-engine/generator.d.ts +2 -0
- package/dist/tailwindcss/v3-engine/index.d.ts +4 -0
- package/dist/tailwindcss/v3-engine/miniprogram.d.ts +4 -0
- package/dist/tailwindcss/v3-engine/source.d.ts +5 -0
- package/dist/tailwindcss/v3-engine/types.d.ts +55 -0
- package/dist/tailwindcss/v4/config.d.ts +5 -0
- package/dist/tailwindcss/v4/css-entries.d.ts +7 -0
- package/dist/tailwindcss/v4/index.d.ts +2 -0
- package/dist/tailwindcss/v4/multi-patcher.d.ts +2 -0
- package/dist/tailwindcss/v4/patcher-options.d.ts +24 -0
- package/dist/tailwindcss/v4/patcher.d.ts +14 -0
- package/dist/tailwindcss/v4-engine/design-system.d.ts +1 -0
- package/dist/tailwindcss/v4-engine/generator.d.ts +2 -0
- package/dist/tailwindcss/v4-engine/index.d.ts +5 -0
- package/dist/tailwindcss/v4-engine/miniprogram.d.ts +4 -0
- package/dist/tailwindcss/v4-engine/source.d.ts +7 -0
- package/dist/tailwindcss/v4-engine/types.d.ts +17 -0
- package/dist/typedoc.export.d.ts +5 -0
- package/dist/types/base.d.ts +1 -0
- package/dist/types/disabled-options.d.ts +4 -0
- package/dist/types/index.d.ts +104 -0
- package/dist/types/shared.d.ts +7 -0
- package/dist/types/user-defined-options/general.d.ts +31 -0
- package/dist/types/user-defined-options/important.d.ts +37 -0
- package/dist/types/user-defined-options/index.d.ts +11 -0
- package/dist/types/user-defined-options/lifecycle.d.ts +6 -0
- package/dist/types/user-defined-options/matcher.d.ts +9 -0
- package/dist/types.d.ts +1 -150
- package/dist/types.js +0 -1
- package/dist/types.mjs +1 -1
- package/dist/uni-app-x/component-local-style.d.ts +19 -0
- package/dist/uni-app-x/index.d.ts +2 -0
- package/dist/uni-app-x/options.d.ts +12 -0
- package/dist/uni-app-x/style-isolation.d.ts +2 -0
- package/dist/uni-app-x/transform.d.ts +9 -0
- package/dist/uni-app-x/vite.d.ts +36 -0
- package/dist/utils/decode.d.ts +2 -0
- package/dist/utils/disabled.d.ts +6 -0
- package/dist/utils/hbuilderx.d.ts +5 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/nameMatcher.d.ts +4 -0
- package/dist/utils/resolve-package.d.ts +1 -0
- package/dist/utils/uni-platform.d.ts +11 -0
- package/dist/utils-7DUGTFED.mjs +48 -0
- package/dist/utils-DmC9_In3.js +61 -0
- package/dist/vite-BHpAqldo.js +1952 -0
- package/dist/vite-C8JlHiyR.mjs +1940 -0
- package/dist/vite.d.ts +4 -17
- package/dist/vite.js +5 -14
- package/dist/vite.mjs +2 -14
- package/dist/weapp-tw-css-import-rewrite-loader.js +59 -92
- package/dist/weapp-tw-runtime-classset-loader.js +31 -50
- package/dist/webpack-CABjKGGQ.mjs +441 -0
- package/dist/webpack-DNIJ0ysE.js +456 -0
- package/dist/webpack.d.ts +4 -25
- package/dist/webpack.js +6 -17
- package/dist/webpack.mjs +2 -17
- package/dist/webpack4.d.ts +4 -26
- package/dist/webpack4.js +375 -481
- package/dist/webpack4.mjs +366 -482
- package/dist/wxml/Tokenizer.d.ts +15 -0
- package/dist/wxml/custom-attributes.d.ts +4 -0
- package/dist/wxml/index.d.ts +2 -0
- package/dist/wxml/shared.d.ts +2 -0
- package/dist/wxml/tokenizer/types.d.ts +18 -0
- package/dist/wxml/utils/codegen/legacy-rewriter.d.ts +2 -0
- package/dist/wxml/utils/codegen/legacy-visitor.d.ts +8 -0
- package/dist/wxml/utils/codegen.d.ts +2 -0
- package/dist/wxml/utils/custom-template.d.ts +3 -0
- package/dist/wxml/utils/fragment-helpers.d.ts +6 -0
- package/dist/wxml/utils/fragment-updater.d.ts +4 -0
- package/dist/wxml/utils/template-fragments.d.ts +3 -0
- package/dist/wxml/utils.d.ts +8 -0
- package/dist/wxml/whitespace.d.ts +2 -0
- package/generator-placeholder.css +1 -0
- package/package.json +19 -5
- package/dist/chunk-24AGZQVR.js +0 -183
- package/dist/chunk-3VQKDHGP.mjs +0 -179
- package/dist/chunk-4AFQP74Z.js +0 -24
- package/dist/chunk-57SOQCAU.mjs +0 -582
- package/dist/chunk-5ZYHNDEK.mjs +0 -2439
- package/dist/chunk-76S2EME4.mjs +0 -34
- package/dist/chunk-A5PB4KZT.js +0 -138
- package/dist/chunk-DUHYLR2R.js +0 -276
- package/dist/chunk-DYLQ6UOI.js +0 -71
- package/dist/chunk-E7I5TW5K.js +0 -52
- package/dist/chunk-FS2NOOEB.js +0 -292
- package/dist/chunk-HVNGIKLS.js +0 -3930
- package/dist/chunk-JZQBZHN5.js +0 -579
- package/dist/chunk-KGTVD4EP.mjs +0 -3930
- package/dist/chunk-NNOQDMUP.mjs +0 -10
- package/dist/chunk-OF6MFURR.js +0 -34
- package/dist/chunk-OFB2KBRP.js +0 -2442
- package/dist/chunk-OOHJLO5M.mjs +0 -71
- package/dist/chunk-PCDYXXSK.mjs +0 -1515
- package/dist/chunk-RKISS72P.js +0 -7
- package/dist/chunk-RRQZL7FQ.mjs +0 -292
- package/dist/chunk-XAKAD2CR.mjs +0 -138
- package/dist/chunk-XZP3MREK.mjs +0 -276
- package/dist/chunk-ZAA5ZG3D.js +0 -1518
- package/dist/chunk-ZCH4YINE.mjs +0 -52
- package/dist/cli.d.mts +0 -2
- package/dist/core.d.mts +0 -26
- package/dist/css-macro/postcss.d.mts +0 -7
- package/dist/css-macro.d.mts +0 -18
- package/dist/defaults.d.mts +0 -11
- package/dist/gulp.d.mts +0 -24
- package/dist/index-BXrmQelt.d.mts +0 -672
- package/dist/index-BXrmQelt.d.ts +0 -672
- package/dist/index.d.mts +0 -15
- package/dist/postcss-html-transform.d.mts +0 -2
- package/dist/presets.d.mts +0 -76
- package/dist/reset.d.mts +0 -1
- package/dist/types.d.mts +0 -150
- package/dist/vite.d.mts +0 -17
- package/dist/webpack.d.mts +0 -25
- package/dist/webpack4.d.mts +0 -26
package/dist/chunk-JZQBZHN5.js
DELETED
|
@@ -1,579 +0,0 @@
|
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _chunkFS2NOOEBjs = require('./chunk-FS2NOOEB.js');
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var _chunk24AGZQVRjs = require('./chunk-24AGZQVR.js');
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var _chunkOF6MFURRjs = require('./chunk-OF6MFURR.js');
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var _chunkHVNGIKLSjs = require('./chunk-HVNGIKLS.js');
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var _chunkZAA5ZG3Djs = require('./chunk-ZAA5ZG3D.js');
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
40
|
-
|
|
41
|
-
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
42
|
-
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
43
|
-
|
|
44
|
-
// src/bundlers/webpack/BaseUnifiedPlugin/v5-assets.ts
|
|
45
|
-
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
46
|
-
|
|
47
|
-
function resolveWebpackStaleClassNameFallback(option, _compiler) {
|
|
48
|
-
if (typeof option === "boolean") {
|
|
49
|
-
return option;
|
|
50
|
-
}
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
function setupWebpackV5ProcessAssetsHook(options) {
|
|
54
|
-
const {
|
|
55
|
-
compiler,
|
|
56
|
-
options: compilerOptions,
|
|
57
|
-
appType,
|
|
58
|
-
runtimeState,
|
|
59
|
-
getRuntimeRefreshRequirement,
|
|
60
|
-
refreshRuntimeMetadata,
|
|
61
|
-
consumeRuntimeRefreshRequirement,
|
|
62
|
-
debug: debug2
|
|
63
|
-
} = options;
|
|
64
|
-
const { Compilation, sources } = compiler.webpack;
|
|
65
|
-
const { ConcatSource } = sources;
|
|
66
|
-
const cssHandlerOptionsCache = /* @__PURE__ */ new Map();
|
|
67
|
-
compiler.hooks.compilation.tap(_chunkHVNGIKLSjs.pluginName, (compilation) => {
|
|
68
|
-
compilation.hooks.processAssets.tapPromise(
|
|
69
|
-
{
|
|
70
|
-
name: _chunkHVNGIKLSjs.pluginName,
|
|
71
|
-
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
72
|
-
},
|
|
73
|
-
async (assets) => {
|
|
74
|
-
compilerOptions.onStart();
|
|
75
|
-
debug2("start");
|
|
76
|
-
await runtimeState.patchPromise;
|
|
77
|
-
for (const chunk of compilation.chunks) {
|
|
78
|
-
if (chunk.id && chunk.hash) {
|
|
79
|
-
compilerOptions.cache.calcHashValueChanged(chunk.id, chunk.hash);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
const assetHashByChunk = _chunkFS2NOOEBjs.createAssetHashByChunkMap.call(void 0, compilation.chunks);
|
|
83
|
-
const entries = Object.entries(assets);
|
|
84
|
-
const compilerOutputPath = _nullishCoalesce(_optionalChain([compilation, 'access', _ => _.compiler, 'optionalAccess', _2 => _2.outputPath]), () => ( compiler.outputPath));
|
|
85
|
-
const outputDir = compilerOutputPath ? _path2.default.resolve(compilerOutputPath) : _nullishCoalesce(_optionalChain([compilation, 'access', _3 => _3.outputOptions, 'optionalAccess', _4 => _4.path]), () => ( _process2.default.cwd()));
|
|
86
|
-
const jsAssets = /* @__PURE__ */ new Map();
|
|
87
|
-
for (const [file] of entries) {
|
|
88
|
-
if (compilerOptions.jsMatcher(file) || compilerOptions.wxsMatcher(file)) {
|
|
89
|
-
const absolute = _chunk24AGZQVRjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
90
|
-
jsAssets.set(absolute, file);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
const moduleGraphOptions = {
|
|
94
|
-
resolve(specifier, importer) {
|
|
95
|
-
return _chunk24AGZQVRjs.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => jsAssets.has(candidate));
|
|
96
|
-
},
|
|
97
|
-
load: (id) => {
|
|
98
|
-
const assetName = jsAssets.get(id);
|
|
99
|
-
if (!assetName) {
|
|
100
|
-
return void 0;
|
|
101
|
-
}
|
|
102
|
-
const asset = compilation.getAsset(assetName);
|
|
103
|
-
if (!asset) {
|
|
104
|
-
return void 0;
|
|
105
|
-
}
|
|
106
|
-
const source = asset.source.source();
|
|
107
|
-
return typeof source === "string" ? source : source.toString();
|
|
108
|
-
},
|
|
109
|
-
filter(id) {
|
|
110
|
-
return jsAssets.has(id);
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
const applyLinkedResults = (linked) => {
|
|
114
|
-
if (!linked) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
for (const [id, { code }] of Object.entries(linked)) {
|
|
118
|
-
const assetName = jsAssets.get(id);
|
|
119
|
-
if (!assetName) {
|
|
120
|
-
continue;
|
|
121
|
-
}
|
|
122
|
-
const asset = compilation.getAsset(assetName);
|
|
123
|
-
if (!asset) {
|
|
124
|
-
continue;
|
|
125
|
-
}
|
|
126
|
-
const previousSource = asset.source.source();
|
|
127
|
-
const previous = typeof previousSource === "string" ? previousSource : previousSource.toString();
|
|
128
|
-
if (previous === code) {
|
|
129
|
-
continue;
|
|
130
|
-
}
|
|
131
|
-
const source = new ConcatSource(code);
|
|
132
|
-
compilation.updateAsset(assetName, source);
|
|
133
|
-
compilerOptions.onUpdate(assetName, previous, code);
|
|
134
|
-
debug2("js linked handle: %s", assetName);
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
const groupedEntries = _chunkDYLQ6UOIjs.getGroupedEntries.call(void 0, entries, compilerOptions);
|
|
138
|
-
const getCssHandlerOptions = (file) => {
|
|
139
|
-
const majorVersion = runtimeState.twPatcher.majorVersion;
|
|
140
|
-
const isMainChunk = compilerOptions.mainCssChunkMatcher(file, appType);
|
|
141
|
-
const cacheKey = `${_nullishCoalesce(majorVersion, () => ( "unknown"))}:${isMainChunk ? "1" : "0"}:${file}`;
|
|
142
|
-
const cached = cssHandlerOptionsCache.get(cacheKey);
|
|
143
|
-
if (cached) {
|
|
144
|
-
return cached;
|
|
145
|
-
}
|
|
146
|
-
const created = {
|
|
147
|
-
isMainChunk,
|
|
148
|
-
postcssOptions: {
|
|
149
|
-
options: {
|
|
150
|
-
from: file
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
majorVersion
|
|
154
|
-
};
|
|
155
|
-
cssHandlerOptionsCache.set(cacheKey, created);
|
|
156
|
-
return created;
|
|
157
|
-
};
|
|
158
|
-
const staleClassNameFallback = resolveWebpackStaleClassNameFallback(compilerOptions.staleClassNameFallback, compiler);
|
|
159
|
-
const forceRuntimeRefresh = getRuntimeRefreshRequirement();
|
|
160
|
-
debug2("processAssets ensure runtime set forceRefresh=%s major=%s", forceRuntimeRefresh, _nullishCoalesce(runtimeState.twPatcher.majorVersion, () => ( "unknown")));
|
|
161
|
-
const runtimeSet = await _chunkHVNGIKLSjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
162
|
-
forceRefresh: forceRuntimeRefresh,
|
|
163
|
-
// webpack 的 script-only 热更新可能不会触发 runtime classset loader,
|
|
164
|
-
// 这里强制收集可避免沿用上轮 class set,保证 JS 仅按最新集合精确命中。
|
|
165
|
-
forceCollect: true,
|
|
166
|
-
clearCache: forceRuntimeRefresh,
|
|
167
|
-
allowEmpty: false
|
|
168
|
-
});
|
|
169
|
-
await refreshRuntimeMetadata(forceRuntimeRefresh);
|
|
170
|
-
consumeRuntimeRefreshRequirement();
|
|
171
|
-
const defaultTemplateHandlerOptions = {
|
|
172
|
-
runtimeSet
|
|
173
|
-
};
|
|
174
|
-
debug2("get runtimeSet, class count: %d", runtimeSet.size);
|
|
175
|
-
const tasks = [];
|
|
176
|
-
if (Array.isArray(groupedEntries.html)) {
|
|
177
|
-
for (const element of groupedEntries.html) {
|
|
178
|
-
const [file, originalSource] = element;
|
|
179
|
-
const rawSource = originalSource.source().toString();
|
|
180
|
-
const cacheKey = file;
|
|
181
|
-
const chunkHash = assetHashByChunk.get(file);
|
|
182
|
-
tasks.push(
|
|
183
|
-
_chunkOF6MFURRjs.processCachedTask.call(void 0, {
|
|
184
|
-
cache: compilerOptions.cache,
|
|
185
|
-
cacheKey,
|
|
186
|
-
hashKey: `${file}:asset`,
|
|
187
|
-
rawSource,
|
|
188
|
-
hash: chunkHash,
|
|
189
|
-
applyResult(source) {
|
|
190
|
-
compilation.updateAsset(file, source);
|
|
191
|
-
},
|
|
192
|
-
onCacheHit() {
|
|
193
|
-
debug2("html cache hit: %s", file);
|
|
194
|
-
},
|
|
195
|
-
transform: async () => {
|
|
196
|
-
const wxml = await compilerOptions.templateHandler(rawSource, defaultTemplateHandlerOptions);
|
|
197
|
-
const source = new ConcatSource(wxml);
|
|
198
|
-
compilerOptions.onUpdate(file, rawSource, wxml);
|
|
199
|
-
debug2("html handle: %s", file);
|
|
200
|
-
return {
|
|
201
|
-
result: source
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
})
|
|
205
|
-
);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
const jsTaskFactories = [];
|
|
209
|
-
if (Array.isArray(groupedEntries.js)) {
|
|
210
|
-
for (const [file] of groupedEntries.js) {
|
|
211
|
-
const cacheKey = _chunkFS2NOOEBjs.getCacheKey.call(void 0, file);
|
|
212
|
-
const asset = compilation.getAsset(file);
|
|
213
|
-
if (!asset) {
|
|
214
|
-
continue;
|
|
215
|
-
}
|
|
216
|
-
const absoluteFile = _chunk24AGZQVRjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
217
|
-
const initialSource = asset.source.source();
|
|
218
|
-
const initialRawSource = typeof initialSource === "string" ? initialSource : initialSource.toString();
|
|
219
|
-
const chunkHash = assetHashByChunk.get(file);
|
|
220
|
-
jsTaskFactories.push(async () => {
|
|
221
|
-
await _chunkOF6MFURRjs.processCachedTask.call(void 0, {
|
|
222
|
-
cache: compilerOptions.cache,
|
|
223
|
-
cacheKey,
|
|
224
|
-
hashKey: `${file}:asset`,
|
|
225
|
-
rawSource: initialRawSource,
|
|
226
|
-
hash: chunkHash,
|
|
227
|
-
applyResult(source) {
|
|
228
|
-
compilation.updateAsset(file, source);
|
|
229
|
-
},
|
|
230
|
-
onCacheHit() {
|
|
231
|
-
debug2("js cache hit: %s", file);
|
|
232
|
-
},
|
|
233
|
-
transform: async () => {
|
|
234
|
-
const currentAsset = compilation.getAsset(file);
|
|
235
|
-
const currentSourceValue = _optionalChain([currentAsset, 'optionalAccess', _5 => _5.source, 'access', _6 => _6.source, 'call', _7 => _7()]);
|
|
236
|
-
const currentSource = typeof currentSourceValue === "string" ? currentSourceValue : _nullishCoalesce(_optionalChain([currentSourceValue, 'optionalAccess', _8 => _8.toString, 'call', _9 => _9()]), () => ( ""));
|
|
237
|
-
const handlerOptions = {
|
|
238
|
-
staleClassNameFallback,
|
|
239
|
-
tailwindcssMajorVersion: runtimeState.twPatcher.majorVersion,
|
|
240
|
-
filename: absoluteFile,
|
|
241
|
-
moduleGraph: moduleGraphOptions,
|
|
242
|
-
babelParserOptions: {
|
|
243
|
-
sourceFilename: absoluteFile
|
|
244
|
-
}
|
|
245
|
-
};
|
|
246
|
-
if (_chunkHVNGIKLSjs.shouldSkipJsTransform.call(void 0, currentSource, handlerOptions)) {
|
|
247
|
-
return { result: new ConcatSource(currentSource) };
|
|
248
|
-
}
|
|
249
|
-
const { code, linked } = await compilerOptions.jsHandler(currentSource, runtimeSet, handlerOptions);
|
|
250
|
-
const source = new ConcatSource(code);
|
|
251
|
-
compilerOptions.onUpdate(file, currentSource, code);
|
|
252
|
-
debug2("js handle: %s", file);
|
|
253
|
-
applyLinkedResults(linked);
|
|
254
|
-
return {
|
|
255
|
-
result: source
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
if (Array.isArray(groupedEntries.css)) {
|
|
263
|
-
for (const element of groupedEntries.css) {
|
|
264
|
-
const [file, originalSource] = element;
|
|
265
|
-
const rawSource = originalSource.source().toString();
|
|
266
|
-
const cacheKey = file;
|
|
267
|
-
const chunkHash = assetHashByChunk.get(file);
|
|
268
|
-
tasks.push(
|
|
269
|
-
_chunkOF6MFURRjs.processCachedTask.call(void 0, {
|
|
270
|
-
cache: compilerOptions.cache,
|
|
271
|
-
cacheKey,
|
|
272
|
-
hashKey: `${file}:asset`,
|
|
273
|
-
rawSource,
|
|
274
|
-
hash: chunkHash,
|
|
275
|
-
applyResult(source) {
|
|
276
|
-
compilation.updateAsset(file, source);
|
|
277
|
-
},
|
|
278
|
-
onCacheHit() {
|
|
279
|
-
debug2("css cache hit: %s", file);
|
|
280
|
-
},
|
|
281
|
-
transform: async () => {
|
|
282
|
-
await runtimeState.patchPromise;
|
|
283
|
-
const { css } = await compilerOptions.styleHandler(rawSource, getCssHandlerOptions(file));
|
|
284
|
-
const source = new ConcatSource(css);
|
|
285
|
-
compilerOptions.onUpdate(file, rawSource, css);
|
|
286
|
-
debug2("css handle: %s", file);
|
|
287
|
-
return {
|
|
288
|
-
result: source
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
})
|
|
292
|
-
);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
_chunk24AGZQVRjs.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
|
|
296
|
-
await Promise.all(tasks);
|
|
297
|
-
debug2("end");
|
|
298
|
-
compilerOptions.onEnd();
|
|
299
|
-
}
|
|
300
|
-
);
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
// src/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.ts
|
|
305
|
-
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
function setupWebpackV5Loaders(options) {
|
|
309
|
-
const {
|
|
310
|
-
compiler,
|
|
311
|
-
options: compilerOptions,
|
|
312
|
-
appType,
|
|
313
|
-
weappTailwindcssPackageDir: weappTailwindcssPackageDir2,
|
|
314
|
-
shouldRewriteCssImports,
|
|
315
|
-
runtimeLoaderPath,
|
|
316
|
-
runtimeCssImportRewriteLoaderPath,
|
|
317
|
-
getClassSetInLoader,
|
|
318
|
-
getRuntimeWatchDependencies,
|
|
319
|
-
debug: debug2
|
|
320
|
-
} = options;
|
|
321
|
-
const isMpxApp = _chunkFS2NOOEBjs.isMpx.call(void 0, appType);
|
|
322
|
-
if (shouldRewriteCssImports && isMpxApp) {
|
|
323
|
-
_chunkFS2NOOEBjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
|
|
324
|
-
}
|
|
325
|
-
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
326
|
-
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
327
|
-
const runtimeClassSetLoaderExists = _fs2.default.existsSync(runtimeClassSetLoader);
|
|
328
|
-
const runtimeCssImportRewriteLoaderExists = runtimeCssImportRewriteLoader ? _fs2.default.existsSync(runtimeCssImportRewriteLoader) : false;
|
|
329
|
-
const runtimeLoaderRewriteOptions = shouldRewriteCssImports ? {
|
|
330
|
-
pkgDir: weappTailwindcssPackageDir2,
|
|
331
|
-
appType
|
|
332
|
-
} : void 0;
|
|
333
|
-
const classSetLoaderOptions = {
|
|
334
|
-
getClassSet: getClassSetInLoader,
|
|
335
|
-
getWatchDependencies: getRuntimeWatchDependencies
|
|
336
|
-
};
|
|
337
|
-
const { findRewriteAnchor, findClassSetAnchor } = _chunkFS2NOOEBjs.createLoaderAnchorFinders.call(void 0, appType);
|
|
338
|
-
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
339
|
-
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
340
|
-
} : void 0;
|
|
341
|
-
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
342
|
-
_chunkFS2NOOEBjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
343
|
-
}
|
|
344
|
-
const createRuntimeClassSetLoaderEntry = () => ({
|
|
345
|
-
loader: runtimeClassSetLoader,
|
|
346
|
-
options: classSetLoaderOptions,
|
|
347
|
-
ident: null,
|
|
348
|
-
type: null
|
|
349
|
-
});
|
|
350
|
-
const createCssImportRewriteLoaderEntry = () => {
|
|
351
|
-
if (!runtimeCssImportRewriteLoader) {
|
|
352
|
-
return null;
|
|
353
|
-
}
|
|
354
|
-
return {
|
|
355
|
-
loader: runtimeCssImportRewriteLoader,
|
|
356
|
-
options: cssImportRewriteLoaderOptions,
|
|
357
|
-
ident: null,
|
|
358
|
-
type: null
|
|
359
|
-
};
|
|
360
|
-
};
|
|
361
|
-
const { NormalModule } = compiler.webpack;
|
|
362
|
-
compiler.hooks.compilation.tap(_chunkHVNGIKLSjs.pluginName, (compilation) => {
|
|
363
|
-
NormalModule.getCompilationHooks(compilation).loader.tap(_chunkHVNGIKLSjs.pluginName, (_loaderContext, module) => {
|
|
364
|
-
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
365
|
-
if (!hasRuntimeLoader) {
|
|
366
|
-
return;
|
|
367
|
-
}
|
|
368
|
-
_chunkFS2NOOEBjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, shouldRewriteCssImports && isMpxApp);
|
|
369
|
-
const loaderEntries = module.loaders || [];
|
|
370
|
-
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
371
|
-
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
372
|
-
const isCssModule = _chunkFS2NOOEBjs.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
|
|
373
|
-
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
374
|
-
debug2("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
375
|
-
}
|
|
376
|
-
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && typeof module.resource === "string" && module.resource.includes("app.css")) {
|
|
377
|
-
debug2("app.css module loaders=%o anchors=%o", loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
378
|
-
} else if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && typeof module.resource === "string" && module.resource.endsWith(".css")) {
|
|
379
|
-
debug2("css module seen: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
380
|
-
}
|
|
381
|
-
if (rewriteAnchorIdx === -1 && classSetAnchorIdx === -1 && !isCssModule) {
|
|
382
|
-
return;
|
|
383
|
-
}
|
|
384
|
-
const anchorlessInsert = (entry, position) => {
|
|
385
|
-
if (position === "after") {
|
|
386
|
-
loaderEntries.push(entry);
|
|
387
|
-
} else {
|
|
388
|
-
loaderEntries.unshift(entry);
|
|
389
|
-
}
|
|
390
|
-
};
|
|
391
|
-
if (cssImportRewriteLoaderOptions && runtimeCssImportRewriteLoaderExists && runtimeCssImportRewriteLoader) {
|
|
392
|
-
const existingIndex = loaderEntries.findIndex((entry) => _optionalChain([entry, 'access', _10 => _10.loader, 'optionalAccess', _11 => _11.includes, 'optionalCall', _12 => _12(runtimeCssImportRewriteLoader)]));
|
|
393
|
-
const rewriteLoaderEntry = existingIndex !== -1 ? loaderEntries.splice(existingIndex, 1)[0] : createCssImportRewriteLoaderEntry();
|
|
394
|
-
if (rewriteLoaderEntry) {
|
|
395
|
-
const anchorIndex = findRewriteAnchor(loaderEntries);
|
|
396
|
-
if (anchorIndex === -1) {
|
|
397
|
-
anchorlessInsert(rewriteLoaderEntry, "after");
|
|
398
|
-
} else {
|
|
399
|
-
loaderEntries.splice(anchorIndex + 1, 0, rewriteLoaderEntry);
|
|
400
|
-
}
|
|
401
|
-
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
if (runtimeClassSetLoaderExists && !_chunkFS2NOOEBjs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
405
|
-
const classSetLoaderEntry = createRuntimeClassSetLoaderEntry();
|
|
406
|
-
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
407
|
-
if (anchorIndex === -1) {
|
|
408
|
-
anchorlessInsert(classSetLoaderEntry, "before");
|
|
409
|
-
} else {
|
|
410
|
-
const insertIndex = anchorIndex === -1 ? rewriteAnchorIdx : anchorIndex;
|
|
411
|
-
loaderEntries.splice(insertIndex, 0, classSetLoaderEntry);
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
});
|
|
415
|
-
});
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
419
|
-
var debug = _chunkHVNGIKLSjs.createDebug.call(void 0, );
|
|
420
|
-
var weappTailwindcssPackageDir = _chunk24AGZQVRjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
421
|
-
var UnifiedWebpackPluginV5 = class {
|
|
422
|
-
constructor(options = {}) {
|
|
423
|
-
this.options = _chunkHVNGIKLSjs.getCompilerContext.call(void 0, options);
|
|
424
|
-
this.appType = this.options.appType;
|
|
425
|
-
}
|
|
426
|
-
apply(compiler) {
|
|
427
|
-
compiler.options = compiler.options || {};
|
|
428
|
-
const {
|
|
429
|
-
disabled,
|
|
430
|
-
onLoad,
|
|
431
|
-
runtimeLoaderPath,
|
|
432
|
-
runtimeCssImportRewriteLoaderPath,
|
|
433
|
-
twPatcher: initialTwPatcher,
|
|
434
|
-
refreshTailwindcssPatcher
|
|
435
|
-
} = this.options;
|
|
436
|
-
const disabledOptions = _chunk24AGZQVRjs.resolveDisabledOptions.call(void 0, disabled);
|
|
437
|
-
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
438
|
-
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
439
|
-
const isMpxApp = _chunkFS2NOOEBjs.isMpx.call(void 0, this.appType);
|
|
440
|
-
if (shouldRewriteCssImports) {
|
|
441
|
-
_chunkFS2NOOEBjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
442
|
-
pkgDir: weappTailwindcssPackageDir,
|
|
443
|
-
enabled: true,
|
|
444
|
-
appType: this.appType
|
|
445
|
-
});
|
|
446
|
-
_chunkFS2NOOEBjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
447
|
-
}
|
|
448
|
-
if (disabledOptions.plugin) {
|
|
449
|
-
return;
|
|
450
|
-
}
|
|
451
|
-
const patchRecorderState = _chunkHVNGIKLSjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
452
|
-
source: "runtime",
|
|
453
|
-
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
454
|
-
});
|
|
455
|
-
const runtimeState = {
|
|
456
|
-
twPatcher: initialTwPatcher,
|
|
457
|
-
patchPromise: patchRecorderState.patchPromise,
|
|
458
|
-
refreshTailwindcssPatcher,
|
|
459
|
-
onPatchCompleted: patchRecorderState.onPatchCompleted
|
|
460
|
-
};
|
|
461
|
-
let runtimeSetPrepared = false;
|
|
462
|
-
let runtimeSetSignature;
|
|
463
|
-
let runtimeRefreshRequiredForCompilation = false;
|
|
464
|
-
const runtimeWatchDependencyFiles = /* @__PURE__ */ new Set();
|
|
465
|
-
const runtimeWatchDependencyContexts = /* @__PURE__ */ new Set();
|
|
466
|
-
let runtimeMetadataPrepared = false;
|
|
467
|
-
const updateRuntimeWatchDependencies = async () => {
|
|
468
|
-
runtimeWatchDependencyFiles.clear();
|
|
469
|
-
runtimeWatchDependencyContexts.clear();
|
|
470
|
-
const tailwindOptions = _chunkZAA5ZG3Djs.resolveTailwindcssOptions.call(void 0, runtimeState.twPatcher.options);
|
|
471
|
-
if (_optionalChain([tailwindOptions, 'optionalAccess', _13 => _13.config])) {
|
|
472
|
-
runtimeWatchDependencyFiles.add(tailwindOptions.config);
|
|
473
|
-
}
|
|
474
|
-
for (const entry of _nullishCoalesce(_optionalChain([tailwindOptions, 'optionalAccess', _14 => _14.v4, 'optionalAccess', _15 => _15.cssEntries]), () => ( []))) {
|
|
475
|
-
runtimeWatchDependencyFiles.add(entry);
|
|
476
|
-
}
|
|
477
|
-
for (const source of _nullishCoalesce(_optionalChain([tailwindOptions, 'optionalAccess', _16 => _16.v4, 'optionalAccess', _17 => _17.sources]), () => ( []))) {
|
|
478
|
-
if (_optionalChain([source, 'optionalAccess', _18 => _18.base])) {
|
|
479
|
-
runtimeWatchDependencyContexts.add(source.base);
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
if (typeof runtimeState.twPatcher.collectContentTokens !== "function") {
|
|
483
|
-
return;
|
|
484
|
-
}
|
|
485
|
-
try {
|
|
486
|
-
const report = await runtimeState.twPatcher.collectContentTokens();
|
|
487
|
-
for (const entry of _nullishCoalesce(report.entries, () => ( []))) {
|
|
488
|
-
if (entry.file) {
|
|
489
|
-
runtimeWatchDependencyFiles.add(entry.file);
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
for (const source of _nullishCoalesce(report.sources, () => ( []))) {
|
|
493
|
-
if (_optionalChain([source, 'optionalAccess', _19 => _19.base])) {
|
|
494
|
-
runtimeWatchDependencyContexts.add(source.base);
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
} catch (error) {
|
|
498
|
-
debug("collect runtime watch dependencies failed: %O", error);
|
|
499
|
-
}
|
|
500
|
-
};
|
|
501
|
-
const ensureRuntimeMetadata = async (force = false) => {
|
|
502
|
-
if (runtimeMetadataPrepared && !force) {
|
|
503
|
-
return;
|
|
504
|
-
}
|
|
505
|
-
await updateRuntimeWatchDependencies();
|
|
506
|
-
runtimeMetadataPrepared = true;
|
|
507
|
-
};
|
|
508
|
-
const syncRuntimeRefreshRequirement = () => {
|
|
509
|
-
runtimeRefreshRequiredForCompilation = runtimeRefreshRequiredForCompilation || _chunkFS2NOOEBjs.hasWatchChanges.call(void 0, compiler);
|
|
510
|
-
};
|
|
511
|
-
const resetRuntimePreparation = () => {
|
|
512
|
-
runtimeSetPrepared = false;
|
|
513
|
-
runtimeMetadataPrepared = false;
|
|
514
|
-
syncRuntimeRefreshRequirement();
|
|
515
|
-
};
|
|
516
|
-
_optionalChain([compiler, 'access', _20 => _20.hooks, 'access', _21 => _21.invalid, 'optionalAccess', _22 => _22.tap, 'optionalCall', _23 => _23(_chunkHVNGIKLSjs.pluginName, () => {
|
|
517
|
-
runtimeRefreshRequiredForCompilation = true;
|
|
518
|
-
})]);
|
|
519
|
-
_optionalChain([compiler, 'access', _24 => _24.hooks, 'access', _25 => _25.watchRun, 'optionalAccess', _26 => _26.tap, 'optionalCall', _27 => _27(_chunkHVNGIKLSjs.pluginName, syncRuntimeRefreshRequirement)]);
|
|
520
|
-
if (_optionalChain([compiler, 'access', _28 => _28.hooks, 'access', _29 => _29.thisCompilation, 'optionalAccess', _30 => _30.tap])) {
|
|
521
|
-
compiler.hooks.thisCompilation.tap(_chunkHVNGIKLSjs.pluginName, resetRuntimePreparation);
|
|
522
|
-
} else if (_optionalChain([compiler, 'access', _31 => _31.hooks, 'access', _32 => _32.compilation, 'optionalAccess', _33 => _33.tap])) {
|
|
523
|
-
compiler.hooks.compilation.tap(_chunkHVNGIKLSjs.pluginName, resetRuntimePreparation);
|
|
524
|
-
}
|
|
525
|
-
async function getClassSetInLoader() {
|
|
526
|
-
if (runtimeSetPrepared) {
|
|
527
|
-
return;
|
|
528
|
-
}
|
|
529
|
-
const signature = _chunkZAA5ZG3Djs.getRuntimeClassSetSignature.call(void 0, runtimeState.twPatcher);
|
|
530
|
-
const forceRefresh = runtimeRefreshRequiredForCompilation || signature !== runtimeSetSignature;
|
|
531
|
-
debug("runtime loader ensure class set forceRefresh=%s watchDirty=%s signatureChanged=%s", forceRefresh, runtimeRefreshRequiredForCompilation, signature !== runtimeSetSignature);
|
|
532
|
-
runtimeSetPrepared = true;
|
|
533
|
-
await _chunkHVNGIKLSjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
534
|
-
forceRefresh,
|
|
535
|
-
forceCollect: true,
|
|
536
|
-
clearCache: forceRefresh,
|
|
537
|
-
allowEmpty: true
|
|
538
|
-
});
|
|
539
|
-
await ensureRuntimeMetadata(forceRefresh);
|
|
540
|
-
runtimeSetSignature = signature;
|
|
541
|
-
runtimeRefreshRequiredForCompilation = false;
|
|
542
|
-
}
|
|
543
|
-
onLoad();
|
|
544
|
-
setupWebpackV5Loaders({
|
|
545
|
-
compiler,
|
|
546
|
-
options: this.options,
|
|
547
|
-
appType: this.appType,
|
|
548
|
-
weappTailwindcssPackageDir,
|
|
549
|
-
shouldRewriteCssImports,
|
|
550
|
-
runtimeLoaderPath,
|
|
551
|
-
runtimeCssImportRewriteLoaderPath,
|
|
552
|
-
getClassSetInLoader,
|
|
553
|
-
getRuntimeWatchDependencies() {
|
|
554
|
-
return {
|
|
555
|
-
files: runtimeWatchDependencyFiles,
|
|
556
|
-
contexts: runtimeWatchDependencyContexts
|
|
557
|
-
};
|
|
558
|
-
},
|
|
559
|
-
debug
|
|
560
|
-
});
|
|
561
|
-
setupWebpackV5ProcessAssetsHook({
|
|
562
|
-
compiler,
|
|
563
|
-
options: this.options,
|
|
564
|
-
appType: this.appType,
|
|
565
|
-
runtimeState,
|
|
566
|
-
getRuntimeRefreshRequirement: () => runtimeRefreshRequiredForCompilation,
|
|
567
|
-
refreshRuntimeMetadata: ensureRuntimeMetadata,
|
|
568
|
-
consumeRuntimeRefreshRequirement() {
|
|
569
|
-
runtimeRefreshRequiredForCompilation = false;
|
|
570
|
-
},
|
|
571
|
-
debug
|
|
572
|
-
});
|
|
573
|
-
}
|
|
574
|
-
};
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
exports.weappTailwindcssPackageDir = weappTailwindcssPackageDir; exports.UnifiedWebpackPluginV5 = UnifiedWebpackPluginV5;
|