weapp-tailwindcss 4.12.0 → 5.0.0-next.10
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 +4 -5
- package/bin/weapp-tailwindcss.js +1 -21
- package/dist/babel/index.d.ts +3 -0
- package/dist/bundle-state-BWqi5ZyX.mjs +343 -0
- package/dist/bundle-state-EUbcdKqo.js +410 -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/at-rules.d.ts +2 -0
- package/dist/bundlers/shared/css-cleanup/color-gamut.d.ts +3 -0
- package/dist/bundlers/shared/css-cleanup/root-cleanups.d.ts +4 -0
- package/dist/bundlers/shared/css-cleanup/selectors.d.ts +8 -0
- package/dist/bundlers/shared/css-cleanup.d.ts +3 -0
- package/dist/bundlers/shared/css-imports.d.ts +8 -0
- package/dist/bundlers/shared/generator-css/config-directive.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/directives.d.ts +13 -0
- package/dist/bundlers/shared/generator-css/legacy-compat.d.ts +7 -0
- package/dist/bundlers/shared/generator-css/legacy-selectors.d.ts +5 -0
- package/dist/bundlers/shared/generator-css/legacy-units.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/markers.d.ts +16 -0
- package/dist/bundlers/shared/generator-css/source-files.d.ts +11 -0
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +10 -0
- package/dist/bundlers/shared/generator-css.d.ts +33 -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 +22 -0
- package/dist/bundlers/vite/generate-bundle/candidates.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +20 -0
- package/dist/bundlers/vite/generate-bundle/css-share-scope.d.ts +3 -0
- package/dist/bundlers/vite/generate-bundle/dirty-state.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/js-entries.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/js-handler-options.d.ts +8 -0
- package/dist/bundlers/vite/generate-bundle/js-linking.d.ts +13 -0
- package/dist/bundlers/vite/generate-bundle/metrics.d.ts +17 -0
- package/dist/bundlers/vite/generate-bundle/process-plan.d.ts +9 -0
- package/dist/bundlers/vite/generate-bundle/rollup-assets.d.ts +7 -0
- package/dist/bundlers/vite/generate-bundle/signatures.d.ts +8 -0
- package/dist/bundlers/vite/generate-bundle.d.ts +34 -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/official-tailwind-plugins.d.ts +5 -0
- package/dist/bundlers/vite/postcss-config.d.ts +6 -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 +13 -0
- package/dist/bundlers/vite/runtime-affecting-signature.d.ts +2 -0
- package/dist/bundlers/vite/runtime-class-set.d.ts +22 -0
- package/dist/bundlers/vite/source-candidates.d.ts +18 -0
- package/dist/bundlers/vite/source-scan.d.ts +8 -0
- package/dist/bundlers/vite/tailwind-basedir.d.ts +1 -0
- package/dist/bundlers/vite/utils.d.ts +9 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +21 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +20 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +20 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +10 -0
- package/dist/bundlers/webpack/index.d.ts +1 -0
- package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +14 -0
- package/dist/bundlers/webpack/loaders/weapp-tw-runtime-classset-loader.d.ts +11 -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/cache-BVAiJV3J.js +502 -0
- package/dist/cache-CHs4DXui.mjs +434 -0
- package/dist/chunk-8l464Juk.js +28 -0
- package/dist/cli/context.d.ts +13 -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.d.ts +4 -0
- package/dist/cli/mount-options.d.ts +4 -0
- package/dist/cli/types.d.ts +15 -0
- package/dist/cli/vscode-entry.d.ts +14 -0
- package/dist/cli.d.ts +1 -2
- package/dist/cli.js +1985 -3574
- package/dist/cli.mjs +1962 -3554
- package/dist/constants-BG12WAKw.mjs +44 -0
- package/dist/constants-BeeyfJ9k.js +73 -0
- package/dist/constants.d.ts +12 -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 +131 -180
- package/dist/core.mjs +129 -180
- 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 +2 -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 +16 -11
- package/dist/defaults.js +151 -8
- package/dist/defaults.mjs +143 -7
- package/dist/escape.js +31 -54
- package/dist/escape.mjs +18 -25
- package/dist/generator/index.d.ts +11 -0
- package/dist/generator/options.d.ts +16 -0
- package/dist/generator/types.d.ts +20 -0
- package/dist/generator-DKkhJbOg.js +1531 -0
- package/dist/generator-UBmfduYg.mjs +1432 -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 +370 -13
- package/dist/gulp.mjs +362 -13
- package/dist/incremental-runtime-class-set-BYmzQ-_f.js +1555 -0
- package/dist/incremental-runtime-class-set-BgMW6wf2.mjs +1510 -0
- 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 +5 -0
- package/dist/js/literal-transform.d.ts +2 -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/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/logger/index.d.ts +2 -0
- package/dist/logger-CZUxvJJD.mjs +2 -0
- package/dist/logger-EVNB9z7i.js +1 -0
- package/dist/postcss/config-directive.d.ts +1 -0
- package/dist/postcss/context.d.ts +9 -0
- package/dist/postcss/source-files.d.ts +8 -0
- package/dist/postcss/tailwind-version.d.ts +3 -0
- package/dist/postcss-C7efq3hr.mjs +231 -0
- package/dist/postcss-Dg-_lyHS.js +240 -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 +7 -0
- package/dist/postcss.mjs +2 -0
- package/dist/precheck-B32p-gLI.js +2736 -0
- package/dist/precheck-B4RH6ZNN.mjs +2622 -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 +117 -163
- package/dist/presets.mjs +109 -163
- package/dist/reset/index.d.ts +2 -0
- package/dist/reset.d.ts +2 -4
- package/dist/reset.js +19 -8
- package/dist/reset.mjs +2 -8
- package/dist/runtime-patch-CwN5ya72.mjs +71 -0
- package/dist/runtime-patch-D6mBo_KB.js +85 -0
- 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/source-scan-BaYvNx-k.js +293 -0
- package/dist/source-scan-cGZxoJqP.mjs +254 -0
- package/dist/tailwindcss/index.d.ts +11 -0
- package/dist/tailwindcss/miniprogram.d.ts +5 -0
- package/dist/tailwindcss/patcher-options.d.ts +8 -0
- package/dist/tailwindcss/patcher-resolve.d.ts +4 -0
- package/dist/tailwindcss/patcher.d.ts +12 -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-patch.d.ts +5 -0
- package/dist/tailwindcss/runtime.d.ts +28 -0
- package/dist/tailwindcss/source-scan.d.ts +25 -0
- package/dist/tailwindcss/targets.d.ts +2 -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/css-sources.d.ts +5 -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 +2 -0
- package/dist/tailwindcss/v4/patcher.d.ts +15 -0
- package/dist/tailwindcss/v4-engine/candidates.d.ts +2 -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 +5 -0
- package/dist/tailwindcss/v4-engine/source.d.ts +7 -0
- package/dist/tailwindcss/v4-engine/tailwind-v3-compatibility.d.ts +1 -0
- package/dist/tailwindcss/v4-engine/tailwind-v3-default-colors.d.ts +1 -0
- package/dist/tailwindcss/v4-engine/tailwind-v4-default-colors.d.ts +1 -0
- package/dist/tailwindcss/v4-engine/types.d.ts +19 -0
- package/dist/tailwindcss/version.d.ts +4 -0
- package/dist/tailwindcss-Bu-RWIHx.js +630 -0
- package/dist/tailwindcss-C5IgPlQ0.mjs +579 -0
- package/dist/typedoc.export.d.ts +3 -0
- package/dist/types/base.d.ts +1 -0
- package/dist/types/index.d.ts +97 -0
- package/dist/types/shared.d.ts +10 -0
- package/dist/types/user-defined-options/general.d.ts +29 -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 +5 -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-BiShvil9.js +61 -0
- package/dist/utils-Btw1iOVV.mjs +48 -0
- package/dist/vite-BU74SkOi.mjs +2246 -0
- package/dist/vite-CKjx_5c3.js +2261 -0
- package/dist/vite.d.ts +3 -17
- package/dist/vite.js +4 -14
- package/dist/vite.mjs +2 -14
- package/dist/weapp-tw-css-import-rewrite-loader.js +68 -92
- package/dist/weapp-tw-runtime-classset-loader.js +31 -50
- package/dist/webpack-CAk_ITq7.mjs +713 -0
- package/dist/webpack-damWiYqY.js +723 -0
- package/dist/webpack.d.ts +4 -25
- package/dist/webpack.js +6 -17
- package/dist/webpack.mjs +2 -17
- 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 +39 -38
- 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/webpack4.d.ts +0 -26
- package/dist/webpack4.js +0 -493
- package/dist/webpack4.mjs +0 -495
- package/scripts/postinstall.mjs +0 -59
package/dist/webpack4.js
DELETED
|
@@ -1,493 +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
|
-
var _chunkFS2NOOEBjs = require('./chunk-FS2NOOEB.js');
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var _chunk24AGZQVRjs = require('./chunk-24AGZQVR.js');
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var _chunkOF6MFURRjs = require('./chunk-OF6MFURR.js');
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var _chunkHVNGIKLSjs = require('./chunk-HVNGIKLS.js');
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var _chunkZAA5ZG3Djs = require('./chunk-ZAA5ZG3D.js');
|
|
35
|
-
require('./chunk-A5PB4KZT.js');
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
39
|
-
require('./chunk-RKISS72P.js');
|
|
40
|
-
|
|
41
|
-
// src/bundlers/webpack/BaseUnifiedPlugin/v4.ts
|
|
42
|
-
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
43
|
-
|
|
44
|
-
// src/bundlers/webpack/BaseUnifiedPlugin/v4-assets.ts
|
|
45
|
-
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
46
|
-
|
|
47
|
-
var _webpacksources = require('webpack-sources');
|
|
48
|
-
function resolveWebpackStaleClassNameFallback(option, _compiler) {
|
|
49
|
-
if (typeof option === "boolean") {
|
|
50
|
-
return option;
|
|
51
|
-
}
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
function toWebpackV4AssetCompilation(compilation) {
|
|
55
|
-
return compilation;
|
|
56
|
-
}
|
|
57
|
-
function readWebpackV4AssetSource(asset) {
|
|
58
|
-
const source = asset.source();
|
|
59
|
-
return typeof source === "string" ? source : source.toString();
|
|
60
|
-
}
|
|
61
|
-
function setupWebpackV4EmitHook(options) {
|
|
62
|
-
const {
|
|
63
|
-
compiler,
|
|
64
|
-
options: compilerOptions,
|
|
65
|
-
appType,
|
|
66
|
-
runtimeState,
|
|
67
|
-
debug: debug2
|
|
68
|
-
} = options;
|
|
69
|
-
const cssHandlerOptionsCache = /* @__PURE__ */ new Map();
|
|
70
|
-
compiler.hooks.emit.tapPromise(_chunkHVNGIKLSjs.pluginName, async (compilation) => {
|
|
71
|
-
await runtimeState.patchPromise;
|
|
72
|
-
compilerOptions.onStart();
|
|
73
|
-
debug2("start");
|
|
74
|
-
for (const chunk of compilation.chunks) {
|
|
75
|
-
if (chunk.id && chunk.hash) {
|
|
76
|
-
compilerOptions.cache.calcHashValueChanged(chunk.id, chunk.hash);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
const assetCompilation = toWebpackV4AssetCompilation(compilation);
|
|
80
|
-
const assetHashByChunk = _chunkFS2NOOEBjs.createAssetHashByChunkMap.call(void 0, compilation.chunks);
|
|
81
|
-
const assets = assetCompilation.assets;
|
|
82
|
-
const entries = Object.entries(assets);
|
|
83
|
-
const outputDir = _optionalChain([compiler, 'access', _ => _.options, 'optionalAccess', _2 => _2.output, 'optionalAccess', _3 => _3.path]) ? _path2.default.resolve(compiler.options.output.path) : _process2.default.cwd();
|
|
84
|
-
const jsAssets = /* @__PURE__ */ new Map();
|
|
85
|
-
for (const [file] of entries) {
|
|
86
|
-
if (compilerOptions.jsMatcher(file) || compilerOptions.wxsMatcher(file)) {
|
|
87
|
-
const absolute = _chunk24AGZQVRjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
88
|
-
jsAssets.set(absolute, file);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
const moduleGraphOptions = {
|
|
92
|
-
resolve(specifier, importer) {
|
|
93
|
-
return _chunk24AGZQVRjs.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => jsAssets.has(candidate));
|
|
94
|
-
},
|
|
95
|
-
load: (id) => {
|
|
96
|
-
const assetName = jsAssets.get(id);
|
|
97
|
-
if (!assetName) {
|
|
98
|
-
return void 0;
|
|
99
|
-
}
|
|
100
|
-
const assetSource = assetCompilation.assets[assetName];
|
|
101
|
-
if (!assetSource) {
|
|
102
|
-
return void 0;
|
|
103
|
-
}
|
|
104
|
-
return readWebpackV4AssetSource(assetSource);
|
|
105
|
-
},
|
|
106
|
-
filter(id) {
|
|
107
|
-
return jsAssets.has(id);
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
const applyLinkedResults = (linked) => {
|
|
111
|
-
if (!linked) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
for (const [id, { code }] of Object.entries(linked)) {
|
|
115
|
-
const assetName = jsAssets.get(id);
|
|
116
|
-
if (!assetName) {
|
|
117
|
-
continue;
|
|
118
|
-
}
|
|
119
|
-
const assetSource = assetCompilation.assets[assetName];
|
|
120
|
-
if (!assetSource) {
|
|
121
|
-
continue;
|
|
122
|
-
}
|
|
123
|
-
const previous = readWebpackV4AssetSource(assetSource);
|
|
124
|
-
if (previous === code) {
|
|
125
|
-
continue;
|
|
126
|
-
}
|
|
127
|
-
const source = new (0, _webpacksources.ConcatSource)(code);
|
|
128
|
-
assetCompilation.updateAsset(assetName, source);
|
|
129
|
-
compilerOptions.onUpdate(assetName, previous, code);
|
|
130
|
-
debug2("js linked handle: %s", assetName);
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
const groupedEntries = _chunkDYLQ6UOIjs.getGroupedEntries.call(void 0, entries, compilerOptions);
|
|
134
|
-
const getCssHandlerOptions = (file) => {
|
|
135
|
-
const majorVersion = runtimeState.twPatcher.majorVersion;
|
|
136
|
-
const isMainChunk = compilerOptions.mainCssChunkMatcher(file, appType);
|
|
137
|
-
const cacheKey = `${_nullishCoalesce(majorVersion, () => ( "unknown"))}:${isMainChunk ? "1" : "0"}:${file}`;
|
|
138
|
-
const cached = cssHandlerOptionsCache.get(cacheKey);
|
|
139
|
-
if (cached) {
|
|
140
|
-
return cached;
|
|
141
|
-
}
|
|
142
|
-
const created = {
|
|
143
|
-
isMainChunk,
|
|
144
|
-
postcssOptions: {
|
|
145
|
-
options: {
|
|
146
|
-
from: file
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
majorVersion
|
|
150
|
-
};
|
|
151
|
-
cssHandlerOptionsCache.set(cacheKey, created);
|
|
152
|
-
return created;
|
|
153
|
-
};
|
|
154
|
-
const staleClassNameFallback = resolveWebpackStaleClassNameFallback(compilerOptions.staleClassNameFallback, compiler);
|
|
155
|
-
const runtimeSet = await _chunkHVNGIKLSjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
156
|
-
// webpack 的 script-only 热更新可能不会触发 runtime classset loader,
|
|
157
|
-
// 这里强制收集可避免沿用上轮 class set,保证 JS 仅按最新集合精确命中。
|
|
158
|
-
forceCollect: true,
|
|
159
|
-
allowEmpty: false
|
|
160
|
-
});
|
|
161
|
-
const defaultTemplateHandlerOptions = {
|
|
162
|
-
runtimeSet
|
|
163
|
-
};
|
|
164
|
-
debug2("get runtimeSet, class count: %d", runtimeSet.size);
|
|
165
|
-
const tasks = [];
|
|
166
|
-
if (Array.isArray(groupedEntries.html)) {
|
|
167
|
-
for (const element of groupedEntries.html) {
|
|
168
|
-
const [file, originalSource] = element;
|
|
169
|
-
const rawSource = readWebpackV4AssetSource(originalSource);
|
|
170
|
-
const cacheKey = file;
|
|
171
|
-
const chunkHash = assetHashByChunk.get(file);
|
|
172
|
-
tasks.push(
|
|
173
|
-
_chunkOF6MFURRjs.processCachedTask.call(void 0, {
|
|
174
|
-
cache: compilerOptions.cache,
|
|
175
|
-
cacheKey,
|
|
176
|
-
hashKey: `${file}:asset`,
|
|
177
|
-
rawSource,
|
|
178
|
-
hash: chunkHash,
|
|
179
|
-
applyResult(source) {
|
|
180
|
-
assetCompilation.updateAsset(file, source);
|
|
181
|
-
},
|
|
182
|
-
onCacheHit() {
|
|
183
|
-
debug2("html cache hit: %s", file);
|
|
184
|
-
},
|
|
185
|
-
transform: async () => {
|
|
186
|
-
const wxml = await compilerOptions.templateHandler(rawSource, defaultTemplateHandlerOptions);
|
|
187
|
-
const source = new (0, _webpacksources.ConcatSource)(wxml);
|
|
188
|
-
compilerOptions.onUpdate(file, rawSource, wxml);
|
|
189
|
-
debug2("html handle: %s", file);
|
|
190
|
-
return {
|
|
191
|
-
result: source
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
})
|
|
195
|
-
);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
const jsTaskFactories = [];
|
|
199
|
-
if (Array.isArray(groupedEntries.js)) {
|
|
200
|
-
for (const [file] of groupedEntries.js) {
|
|
201
|
-
const cacheKey = _chunkFS2NOOEBjs.getCacheKey.call(void 0, file);
|
|
202
|
-
const assetSource = assetCompilation.assets[file];
|
|
203
|
-
if (!assetSource) {
|
|
204
|
-
continue;
|
|
205
|
-
}
|
|
206
|
-
const initialRawSource = readWebpackV4AssetSource(assetSource);
|
|
207
|
-
const absoluteFile = _chunk24AGZQVRjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
208
|
-
const chunkHash = assetHashByChunk.get(file);
|
|
209
|
-
const sourceAwareHash = chunkHash ? `${chunkHash}:${compilerOptions.cache.computeHash(initialRawSource)}` : void 0;
|
|
210
|
-
jsTaskFactories.push(async () => {
|
|
211
|
-
await _chunkOF6MFURRjs.processCachedTask.call(void 0, {
|
|
212
|
-
cache: compilerOptions.cache,
|
|
213
|
-
cacheKey,
|
|
214
|
-
hashKey: `${file}:asset`,
|
|
215
|
-
rawSource: initialRawSource,
|
|
216
|
-
hash: sourceAwareHash,
|
|
217
|
-
applyResult(source) {
|
|
218
|
-
assetCompilation.updateAsset(file, source);
|
|
219
|
-
},
|
|
220
|
-
onCacheHit() {
|
|
221
|
-
debug2("js cache hit: %s", file);
|
|
222
|
-
},
|
|
223
|
-
transform: async () => {
|
|
224
|
-
const currentAsset = assetCompilation.assets[file];
|
|
225
|
-
const currentSource = currentAsset ? readWebpackV4AssetSource(currentAsset) : "";
|
|
226
|
-
const handlerOptions = {
|
|
227
|
-
staleClassNameFallback,
|
|
228
|
-
tailwindcssMajorVersion: runtimeState.twPatcher.majorVersion,
|
|
229
|
-
filename: absoluteFile,
|
|
230
|
-
moduleGraph: moduleGraphOptions,
|
|
231
|
-
babelParserOptions: {
|
|
232
|
-
sourceFilename: absoluteFile
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
if (_chunkHVNGIKLSjs.shouldSkipJsTransform.call(void 0, currentSource, handlerOptions)) {
|
|
236
|
-
return { result: new (0, _webpacksources.ConcatSource)(currentSource) };
|
|
237
|
-
}
|
|
238
|
-
const { code, linked } = await compilerOptions.jsHandler(currentSource, runtimeSet, handlerOptions);
|
|
239
|
-
const source = new (0, _webpacksources.ConcatSource)(code);
|
|
240
|
-
compilerOptions.onUpdate(file, currentSource, code);
|
|
241
|
-
debug2("js handle: %s", file);
|
|
242
|
-
applyLinkedResults(linked);
|
|
243
|
-
return {
|
|
244
|
-
result: source
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
if (Array.isArray(groupedEntries.css)) {
|
|
252
|
-
for (const element of groupedEntries.css) {
|
|
253
|
-
const [file, originalSource] = element;
|
|
254
|
-
const rawSource = readWebpackV4AssetSource(originalSource);
|
|
255
|
-
const cacheKey = file;
|
|
256
|
-
const chunkHash = assetHashByChunk.get(file);
|
|
257
|
-
tasks.push(
|
|
258
|
-
_chunkOF6MFURRjs.processCachedTask.call(void 0, {
|
|
259
|
-
cache: compilerOptions.cache,
|
|
260
|
-
cacheKey,
|
|
261
|
-
hashKey: `${file}:asset`,
|
|
262
|
-
rawSource,
|
|
263
|
-
hash: chunkHash,
|
|
264
|
-
applyResult(source) {
|
|
265
|
-
assetCompilation.updateAsset(file, source);
|
|
266
|
-
},
|
|
267
|
-
onCacheHit() {
|
|
268
|
-
debug2("css cache hit: %s", file);
|
|
269
|
-
},
|
|
270
|
-
transform: async () => {
|
|
271
|
-
await runtimeState.patchPromise;
|
|
272
|
-
const { css } = await compilerOptions.styleHandler(rawSource, getCssHandlerOptions(file));
|
|
273
|
-
const source = new (0, _webpacksources.ConcatSource)(css);
|
|
274
|
-
compilerOptions.onUpdate(file, rawSource, css);
|
|
275
|
-
debug2("css handle: %s", file);
|
|
276
|
-
return {
|
|
277
|
-
result: source
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
})
|
|
281
|
-
);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
_chunk24AGZQVRjs.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
|
|
285
|
-
await Promise.all(tasks);
|
|
286
|
-
debug2("end");
|
|
287
|
-
compilerOptions.onEnd();
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
// src/bundlers/webpack/BaseUnifiedPlugin/v4-loaders.ts
|
|
292
|
-
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
function setupWebpackV4Loaders(options) {
|
|
296
|
-
const {
|
|
297
|
-
compiler,
|
|
298
|
-
options: compilerOptions,
|
|
299
|
-
appType,
|
|
300
|
-
weappTailwindcssPackageDir: weappTailwindcssPackageDir2,
|
|
301
|
-
shouldRewriteCssImports,
|
|
302
|
-
runtimeLoaderPath,
|
|
303
|
-
runtimeCssImportRewriteLoaderPath,
|
|
304
|
-
getClassSetInLoader,
|
|
305
|
-
debug: debug2
|
|
306
|
-
} = options;
|
|
307
|
-
const isMpxApp = _chunkFS2NOOEBjs.isMpx.call(void 0, appType);
|
|
308
|
-
if (shouldRewriteCssImports && isMpxApp) {
|
|
309
|
-
_chunkFS2NOOEBjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
|
|
310
|
-
}
|
|
311
|
-
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
312
|
-
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
313
|
-
const runtimeClassSetLoaderExists = _fs2.default.existsSync(runtimeClassSetLoader);
|
|
314
|
-
const runtimeCssImportRewriteLoaderExists = runtimeCssImportRewriteLoader ? _fs2.default.existsSync(runtimeCssImportRewriteLoader) : false;
|
|
315
|
-
const runtimeLoaderRewriteOptions = shouldRewriteCssImports ? {
|
|
316
|
-
pkgDir: weappTailwindcssPackageDir2,
|
|
317
|
-
appType
|
|
318
|
-
} : void 0;
|
|
319
|
-
const classSetLoaderOptions = {
|
|
320
|
-
getClassSet: getClassSetInLoader
|
|
321
|
-
};
|
|
322
|
-
const { findRewriteAnchor, findClassSetAnchor } = _chunkFS2NOOEBjs.createLoaderAnchorFinders.call(void 0, appType);
|
|
323
|
-
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
324
|
-
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
325
|
-
} : void 0;
|
|
326
|
-
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
327
|
-
_chunkFS2NOOEBjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
328
|
-
}
|
|
329
|
-
const createRuntimeClassSetLoaderEntry = () => ({
|
|
330
|
-
loader: runtimeClassSetLoader,
|
|
331
|
-
options: classSetLoaderOptions,
|
|
332
|
-
ident: null,
|
|
333
|
-
type: null
|
|
334
|
-
});
|
|
335
|
-
const createCssImportRewriteLoaderEntry = () => {
|
|
336
|
-
if (!runtimeCssImportRewriteLoader) {
|
|
337
|
-
return null;
|
|
338
|
-
}
|
|
339
|
-
return {
|
|
340
|
-
loader: runtimeCssImportRewriteLoader,
|
|
341
|
-
options: cssImportRewriteLoaderOptions,
|
|
342
|
-
ident: null,
|
|
343
|
-
type: null
|
|
344
|
-
};
|
|
345
|
-
};
|
|
346
|
-
compiler.hooks.compilation.tap(_chunkHVNGIKLSjs.pluginName, (compilation) => {
|
|
347
|
-
compilation.hooks.normalModuleLoader.tap(_chunkHVNGIKLSjs.pluginName, (_loaderContext, module) => {
|
|
348
|
-
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
349
|
-
if (!hasRuntimeLoader) {
|
|
350
|
-
return;
|
|
351
|
-
}
|
|
352
|
-
if (shouldRewriteCssImports && _chunkFS2NOOEBjs.isMpx.call(void 0, appType) && typeof _loaderContext.resolve === "function") {
|
|
353
|
-
_chunkFS2NOOEBjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, true);
|
|
354
|
-
}
|
|
355
|
-
const loaderEntries = module.loaders || [];
|
|
356
|
-
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
357
|
-
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
358
|
-
const isCssModule = _chunkFS2NOOEBjs.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
|
|
359
|
-
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
360
|
-
debug2("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
361
|
-
}
|
|
362
|
-
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && typeof module.resource === "string" && module.resource.includes("app.css")) {
|
|
363
|
-
debug2("app.css module loaders=%o anchors=%o", loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
364
|
-
} else if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && typeof module.resource === "string" && module.resource.endsWith(".css")) {
|
|
365
|
-
debug2("css module seen: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
366
|
-
}
|
|
367
|
-
if (rewriteAnchorIdx === -1 && classSetAnchorIdx === -1 && !isCssModule) {
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
const anchorlessInsert = (entry, position) => {
|
|
371
|
-
if (position === "after") {
|
|
372
|
-
loaderEntries.push(entry);
|
|
373
|
-
} else {
|
|
374
|
-
loaderEntries.unshift(entry);
|
|
375
|
-
}
|
|
376
|
-
};
|
|
377
|
-
if (runtimeLoaderRewriteOptions && runtimeCssImportRewriteLoaderExists && cssImportRewriteLoaderOptions && runtimeCssImportRewriteLoader) {
|
|
378
|
-
const existingIndex = loaderEntries.findIndex(
|
|
379
|
-
(entry) => _optionalChain([entry, 'access', _4 => _4.loader, 'optionalAccess', _5 => _5.includes, 'optionalCall', _6 => _6(runtimeCssImportRewriteLoader)])
|
|
380
|
-
);
|
|
381
|
-
const rewriteEntry = existingIndex !== -1 ? loaderEntries.splice(existingIndex, 1)[0] : createCssImportRewriteLoaderEntry();
|
|
382
|
-
if (rewriteEntry) {
|
|
383
|
-
const anchorIndex = findRewriteAnchor(loaderEntries);
|
|
384
|
-
if (anchorIndex === -1) {
|
|
385
|
-
anchorlessInsert(rewriteEntry, "after");
|
|
386
|
-
} else {
|
|
387
|
-
loaderEntries.splice(anchorIndex + 1, 0, rewriteEntry);
|
|
388
|
-
}
|
|
389
|
-
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
if (runtimeClassSetLoaderExists && !_chunkFS2NOOEBjs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
393
|
-
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
394
|
-
if (anchorIndex === -1) {
|
|
395
|
-
anchorlessInsert(createRuntimeClassSetLoaderEntry(), "before");
|
|
396
|
-
} else {
|
|
397
|
-
const insertIndex = anchorIndex === -1 ? rewriteAnchorIdx : anchorIndex;
|
|
398
|
-
loaderEntries.splice(insertIndex, 0, createRuntimeClassSetLoaderEntry());
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
});
|
|
402
|
-
});
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
// src/bundlers/webpack/BaseUnifiedPlugin/v4.ts
|
|
406
|
-
var debug = _chunkHVNGIKLSjs.createDebug.call(void 0, );
|
|
407
|
-
var weappTailwindcssPackageDir = _chunk24AGZQVRjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
408
|
-
var UnifiedWebpackPluginV4 = class {
|
|
409
|
-
constructor(options = {}) {
|
|
410
|
-
this.options = _chunkHVNGIKLSjs.getCompilerContext.call(void 0, options);
|
|
411
|
-
this.appType = this.options.appType;
|
|
412
|
-
}
|
|
413
|
-
apply(compiler) {
|
|
414
|
-
compiler.options = compiler.options || {};
|
|
415
|
-
const {
|
|
416
|
-
disabled,
|
|
417
|
-
onLoad,
|
|
418
|
-
runtimeLoaderPath,
|
|
419
|
-
runtimeCssImportRewriteLoaderPath,
|
|
420
|
-
twPatcher: initialTwPatcher,
|
|
421
|
-
refreshTailwindcssPatcher
|
|
422
|
-
} = this.options;
|
|
423
|
-
const disabledOptions = _chunk24AGZQVRjs.resolveDisabledOptions.call(void 0, disabled);
|
|
424
|
-
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
425
|
-
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
426
|
-
const isMpxApp = _chunkFS2NOOEBjs.isMpx.call(void 0, this.appType);
|
|
427
|
-
if (shouldRewriteCssImports) {
|
|
428
|
-
_chunkFS2NOOEBjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
429
|
-
pkgDir: weappTailwindcssPackageDir,
|
|
430
|
-
enabled: true,
|
|
431
|
-
appType: this.appType
|
|
432
|
-
});
|
|
433
|
-
_chunkFS2NOOEBjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
434
|
-
}
|
|
435
|
-
if (disabledOptions.plugin) {
|
|
436
|
-
return;
|
|
437
|
-
}
|
|
438
|
-
const patchRecorderState = _chunkHVNGIKLSjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
439
|
-
source: "runtime",
|
|
440
|
-
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
441
|
-
});
|
|
442
|
-
const runtimeState = {
|
|
443
|
-
twPatcher: initialTwPatcher,
|
|
444
|
-
patchPromise: patchRecorderState.patchPromise,
|
|
445
|
-
refreshTailwindcssPatcher,
|
|
446
|
-
onPatchCompleted: patchRecorderState.onPatchCompleted
|
|
447
|
-
};
|
|
448
|
-
let runtimeSetPrepared = false;
|
|
449
|
-
let runtimeSetSignature;
|
|
450
|
-
compiler.hooks.compilation.tap(_chunkHVNGIKLSjs.pluginName, () => {
|
|
451
|
-
runtimeSetPrepared = false;
|
|
452
|
-
});
|
|
453
|
-
async function getClassSetInLoader() {
|
|
454
|
-
if (runtimeSetPrepared) {
|
|
455
|
-
return;
|
|
456
|
-
}
|
|
457
|
-
const signature = _chunkZAA5ZG3Djs.getRuntimeClassSetSignature.call(void 0, runtimeState.twPatcher);
|
|
458
|
-
const forceRefresh = signature !== runtimeSetSignature;
|
|
459
|
-
runtimeSetPrepared = true;
|
|
460
|
-
await _chunkHVNGIKLSjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
461
|
-
forceRefresh,
|
|
462
|
-
forceCollect: true,
|
|
463
|
-
clearCache: forceRefresh,
|
|
464
|
-
allowEmpty: true
|
|
465
|
-
});
|
|
466
|
-
runtimeSetSignature = signature;
|
|
467
|
-
}
|
|
468
|
-
onLoad();
|
|
469
|
-
setupWebpackV4Loaders({
|
|
470
|
-
compiler,
|
|
471
|
-
options: this.options,
|
|
472
|
-
appType: this.appType,
|
|
473
|
-
weappTailwindcssPackageDir,
|
|
474
|
-
shouldRewriteCssImports,
|
|
475
|
-
runtimeLoaderPath,
|
|
476
|
-
runtimeCssImportRewriteLoaderPath,
|
|
477
|
-
getClassSetInLoader,
|
|
478
|
-
debug
|
|
479
|
-
});
|
|
480
|
-
setupWebpackV4EmitHook({
|
|
481
|
-
compiler,
|
|
482
|
-
options: this.options,
|
|
483
|
-
appType: this.appType,
|
|
484
|
-
runtimeState,
|
|
485
|
-
debug
|
|
486
|
-
});
|
|
487
|
-
}
|
|
488
|
-
};
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
exports.UnifiedWebpackPluginV4 = UnifiedWebpackPluginV4; exports.weappTailwindcss = UnifiedWebpackPluginV4; exports.weappTailwindcssPackageDir = weappTailwindcssPackageDir;
|