webpack 5.111.0 → 5.111.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.
Files changed (144) hide show
  1. package/lib/APIPlugin.js +3 -4
  2. package/lib/CompatibilityPlugin.js +3 -4
  3. package/lib/Compilation.js +16 -35
  4. package/lib/Compiler.js +4 -5
  5. package/lib/ConstPlugin.js +16 -132
  6. package/lib/DependencyTemplate.js +2 -1
  7. package/lib/DotenvPlugin.js +24 -28
  8. package/lib/ErrorHelpers.js +113 -0
  9. package/lib/ExportsInfo.js +20 -16
  10. package/lib/ExternalModule.js +6 -8
  11. package/lib/FlagDependencyExportsPlugin.js +8 -13
  12. package/lib/FlagDependencyUsagePlugin.js +9 -13
  13. package/lib/Generator.js +24 -2
  14. package/lib/HotModuleReplacementPlugin.js +2 -0
  15. package/lib/IgnorePlugin.js +1 -1
  16. package/lib/LoaderOptionsPlugin.js +1 -1
  17. package/lib/Module.js +3 -3
  18. package/lib/ModuleGraph.js +6 -9
  19. package/lib/MultiCompiler.js +6 -16
  20. package/lib/NormalModule.js +96 -44
  21. package/lib/RuntimeTemplate.js +33 -43
  22. package/lib/SourceMapDevToolPlugin.js +53 -103
  23. package/lib/TemplatedPathPlugin.js +16 -59
  24. package/lib/asset/AssetBytesGenerator.js +7 -1
  25. package/lib/asset/AssetGenerator.js +25 -16
  26. package/lib/asset/AssetSourceGenerator.js +7 -1
  27. package/lib/buildChunkGraph.js +11 -15
  28. package/lib/cache/MemoryCachePlugin.js +4 -4
  29. package/lib/cache/MemoryWithGcCachePlugin.js +7 -8
  30. package/lib/cache/PackFileCacheStrategy.js +3 -18
  31. package/lib/cache/getLazyHashedEtag.js +3 -5
  32. package/lib/config/browserslistTargetHandler.js +2 -8
  33. package/lib/config/defaults.js +52 -78
  34. package/lib/config/getClaimedAssetTypes.js +10 -11
  35. package/lib/config/target.js +3 -4
  36. package/lib/{ContextExclusionPlugin.js → context/ContextExclusionPlugin.js} +1 -1
  37. package/lib/{ContextModule.js → context/ContextModule.js} +37 -34
  38. package/lib/{ContextModuleFactory.js → context/ContextModuleFactory.js} +19 -21
  39. package/lib/{ContextReplacementPlugin.js → context/ContextReplacementPlugin.js} +4 -4
  40. package/lib/css/CssGenerator.js +19 -11
  41. package/lib/css/CssParser.js +18 -20
  42. package/lib/css/cssMinify.js +32 -29
  43. package/lib/css/data.js +797 -288
  44. package/lib/css/syntax.js +2250 -934
  45. package/lib/debug/ProfilingPlugin.js +3 -4
  46. package/lib/dependencies/CommonJsExportRequireDependency.js +10 -11
  47. package/lib/dependencies/CommonJsImportsParserPlugin.js +4 -5
  48. package/lib/dependencies/CommonJsSelfReferenceDependency.js +2 -4
  49. package/lib/dependencies/ContextDependency.js +1 -1
  50. package/lib/dependencies/ContextDependencyHelpers.js +3 -9
  51. package/lib/dependencies/ContextElementDependency.js +1 -1
  52. package/lib/dependencies/CssIcssExportDependency.js +6 -8
  53. package/lib/dependencies/CssIcssImportDependency.js +3 -6
  54. package/lib/dependencies/CssUrlDependency.js +3 -5
  55. package/lib/dependencies/HarmonyCompatibilityDependency.js +11 -20
  56. package/lib/dependencies/HarmonyDetectionParserPlugin.js +3 -4
  57. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +2 -4
  58. package/lib/dependencies/HarmonyExportExpressionDependency.js +3 -4
  59. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +3 -4
  60. package/lib/dependencies/HarmonyExportInitFragment.js +26 -19
  61. package/lib/dependencies/HarmonyExportSpecifierDependency.js +7 -28
  62. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +103 -16
  63. package/lib/dependencies/HarmonyImportSideEffectDependency.js +3 -4
  64. package/lib/dependencies/HarmonyImportSpecifierDependency.js +16 -2
  65. package/lib/dependencies/HtmlEntryDependency.js +74 -102
  66. package/lib/dependencies/HtmlInlineScriptDependency.js +3 -4
  67. package/lib/dependencies/HtmlInlineStyleDependency.js +3 -4
  68. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +1 -1
  69. package/lib/dependencies/ImportMetaGlobHelpers.js +1 -1
  70. package/lib/dependencies/ImportMetaPlugin.js +8 -10
  71. package/lib/dependencies/ImportParserPlugin.js +1 -1
  72. package/lib/dependencies/LoaderPlugin.js +26 -1
  73. package/lib/dependencies/RequireContextDependencyParserPlugin.js +1 -1
  74. package/lib/dependencies/URLContextDependency.js +1 -1
  75. package/lib/dependencies/URLDependency.js +6 -5
  76. package/lib/dependencies/WorkerAndWorkletPlugin.js +15 -21
  77. package/lib/dependencies/WorkerDependency.js +6 -5
  78. package/lib/dependencies/WorkletDependency.js +6 -9
  79. package/lib/errors/HookWebpackError.js +3 -2
  80. package/lib/hmr/LazyCompilationPlugin.js +3 -5
  81. package/lib/html/HtmlGenerator.js +61 -82
  82. package/lib/html/HtmlModulesPlugin.js +88 -139
  83. package/lib/html/HtmlParser.js +97 -141
  84. package/lib/html/data.js +21 -0
  85. package/lib/html/htmlMinify.js +10 -11
  86. package/lib/html/syntax.js +883 -993
  87. package/lib/index.js +46 -3
  88. package/lib/javascript/ChunkFormatHelpers.js +4 -3
  89. package/lib/javascript/JavascriptGenerator.js +8 -1
  90. package/lib/javascript/JavascriptModulesPlugin.js +21 -48
  91. package/lib/javascript/JavascriptParser.js +721 -178
  92. package/lib/javascript/parser.js +6 -0
  93. package/lib/javascript/syntax.js +420 -92
  94. package/lib/json/JsonGenerator.js +7 -1
  95. package/lib/library/ModuleLibraryPlugin.js +64 -136
  96. package/lib/loaders/LoaderRunner.js +137 -9
  97. package/lib/node/NodeWatchFileSystem.js +3 -9
  98. package/lib/optimize/AggressiveMergingPlugin.js +3 -5
  99. package/lib/optimize/ConcatenatedModule.js +81 -100
  100. package/lib/optimize/FlagIncludedChunksPlugin.js +3 -11
  101. package/lib/optimize/InnerGraphPlugin.js +7 -13
  102. package/lib/optimize/LimitChunkCountPlugin.js +5 -8
  103. package/lib/optimize/MangleExportsPlugin.js +3 -4
  104. package/lib/optimize/ModuleConcatenationPlugin.js +3 -4
  105. package/lib/optimize/SideEffectsFlagPlugin.js +7 -19
  106. package/lib/optimize/SplitChunksPlugin.js +2 -4
  107. package/lib/performance/BroadContextsPlugin.js +1 -1
  108. package/lib/performance/CacheEffectivenessPlugin.js +3 -4
  109. package/lib/performance/SizeLimitsPlugin.js +2 -4
  110. package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +6 -8
  111. package/lib/prefetch/ResourceHintPlugin.js +17 -21
  112. package/lib/prefetch/StartupAssetHintRuntimeModule.js +7 -10
  113. package/lib/runtime/AsyncModuleRuntimeModule.js +3 -5
  114. package/lib/runtime/GetChunkFilenameRuntimeModule.js +3 -4
  115. package/lib/runtime/GlobalRuntimeModule.js +2 -4
  116. package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +55 -85
  117. package/lib/schemes/DataUriPlugin.js +3 -6
  118. package/lib/schemes/VirtualUrlPlugin.js +1 -1
  119. package/lib/serialization/BinaryMiddleware.js +9 -9
  120. package/lib/serialization/FileMiddleware.js +16 -16
  121. package/lib/serialization/ObjectMiddleware.js +30 -33
  122. package/lib/stats/DefaultStatsFactoryPlugin.js +3 -4
  123. package/lib/typescript/TypeScriptPlugin.js +2 -3
  124. package/lib/url/URLParserPlugin.js +6 -8
  125. package/lib/util/LocConverter.js +4 -7
  126. package/lib/util/SourceProcessor.js +15 -22
  127. package/lib/util/chainedImports.js +3 -4
  128. package/lib/util/concatenate.js +4 -4
  129. package/lib/util/createHooksRegistry.js +1 -2
  130. package/lib/util/dataURL.js +2 -3
  131. package/lib/util/deterministicGrouping.js +8 -13
  132. package/lib/util/findGraphRoots.js +6 -13
  133. package/lib/util/globUtils.js +1 -1
  134. package/lib/util/hash/wasm-hash.js +3 -4
  135. package/lib/util/internalSerializables.js +1 -1
  136. package/lib/util/semver.js +5 -3
  137. package/lib/wasm-async/AsyncWebAssemblyGenerator.js +6 -1
  138. package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +5 -1
  139. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +3 -4
  140. package/lib/wasm-sync/WebAssemblyGenerator.js +6 -1
  141. package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +5 -1
  142. package/lib/wasm-sync/WebAssemblyUtils.js +2 -4
  143. package/package.json +30 -23
  144. package/types.d.ts +299 -280
@@ -6,25 +6,25 @@
6
6
  "use strict";
7
7
 
8
8
  const { AsyncSeriesWaterfallHook, SyncWaterfallHook } = require("tapable");
9
- const ContextModule = require("./ContextModule");
10
- const ModuleFactory = require("./ModuleFactory");
11
- const ContextElementDependency = require("./dependencies/ContextElementDependency");
12
- const LazySet = require("./util/LazySet");
13
- const asyncLib = require("./util/async");
14
- const { cachedSetProperty } = require("./util/cleverMerge");
15
- const { createFakeHook } = require("./util/deprecation");
16
- const { join } = require("./util/fs");
9
+ const ModuleFactory = require("../ModuleFactory");
10
+ const ContextElementDependency = require("../dependencies/ContextElementDependency");
11
+ const LazySet = require("../util/LazySet");
12
+ const asyncLib = require("../util/async");
13
+ const { cachedSetProperty } = require("../util/cleverMerge");
14
+ const { createFakeHook } = require("../util/deprecation");
15
+ const { join } = require("../util/fs");
17
16
  const {
18
17
  globPatternBaseReachesDir,
19
18
  globUserRequest,
20
19
  isNonExhaustiveImportMetaGlobSkippedDir,
21
20
  resolveContextModuleGlobPattern
22
- } = require("./util/globUtils");
21
+ } = require("../util/globUtils");
22
+ const ContextModule = require("./ContextModule");
23
23
 
24
- /** @import { ResolvedContextModuleGlobPattern } from "./util/globUtils" */
24
+ /** @import { ResolvedContextModuleGlobPattern } from "../util/globUtils" */
25
25
  /** @typedef {(context: string, subResource: string, callback: () => void, resolvedGlobPatterns?: ResolvedContextModuleGlobPattern[]) => void} AddSubDirectoryFn */
26
26
  /** @import { ResolveRequest } from "enhanced-resolve" */
27
- /** @import { FileSystemDependencies } from "./Compilation" */
27
+ /** @import { FileSystemDependencies } from "../Compilation" */
28
28
  /**
29
29
  * @import {
30
30
  * ContextModuleOptions,
@@ -36,17 +36,17 @@ const {
36
36
  * @import {
37
37
  * ModuleFactoryCreateData,
38
38
  * ModuleFactoryCallback
39
- * } from "./ModuleFactory"
39
+ * } from "../ModuleFactory"
40
40
  */
41
- /** @import ResolverFactory from "./ResolverFactory" */
42
- /** @import ContextDependency from "./dependencies/ContextDependency" */
41
+ /** @import ResolverFactory from "../ResolverFactory" */
42
+ /** @import ContextDependency from "../dependencies/ContextDependency" */
43
43
 
44
44
  /**
45
45
  * Defines the shared type used by this module.
46
46
  * @template T
47
- * @typedef {import("./util/deprecation").FakeHook<T>} FakeHook<T>
47
+ * @typedef {import("../util/deprecation").FakeHook<T>} FakeHook<T>
48
48
  */
49
- /** @import { IStats, InputFileSystem } from "./util/fs" */
49
+ /** @import { IStats, InputFileSystem } from "../util/fs" */
50
50
  /** @typedef {{ context: string, request: string }} ContextAlternativeRequest */
51
51
 
52
52
  /**
@@ -531,11 +531,9 @@ class ContextModuleFactory extends ModuleFactory {
531
531
  }
532
532
  return callback();
533
533
  }
534
- // Collect for a single batched alternativeRequests call
535
- // per directory below. Calling the hook once per file
536
- // would pay per-call overhead (closure, resolverFactory
537
- // lookup, array allocations) for every file in the
538
- // context — which is the bulk of work on rebuilds.
534
+ // Collected for one batched `alternativeRequests` call per
535
+ // directory: calling the hook per file would pay its overhead
536
+ // across the whole context, the bulk of a rebuild.
539
537
  fileObjs.push({
540
538
  context: ctx,
541
539
  request: `.${subResource.slice(ctx.length).replace(/\\/g, "/")}`
@@ -5,10 +5,10 @@
5
5
 
6
6
  "use strict";
7
7
 
8
- const ContextElementDependency = require("./dependencies/ContextElementDependency");
9
- const { isAbsolute, join } = require("./util/fs");
8
+ const ContextElementDependency = require("../dependencies/ContextElementDependency");
9
+ const { isAbsolute, join } = require("../util/fs");
10
10
 
11
- /** @import Compiler from "./Compiler" */
11
+ /** @import Compiler from "../Compiler" */
12
12
  /** @import { ContextModuleOptions } from "./ContextModule" */
13
13
  /**
14
14
  * @import {
@@ -16,7 +16,7 @@ const { isAbsolute, join } = require("./util/fs");
16
16
  * AfterContextResolveData
17
17
  * } from "./ContextModuleFactory"
18
18
  */
19
- /** @import { InputFileSystem } from "./util/fs" */
19
+ /** @import { InputFileSystem } from "../util/fs" */
20
20
 
21
21
  /** @typedef {Record<string, string>} NewContentCreateContextMap */
22
22
 
@@ -618,10 +618,21 @@ class CssGenerator extends Generator {
618
618
  generateError(error, module, generateContext) {
619
619
  switch (generateContext.type) {
620
620
  case JAVASCRIPT_TYPE: {
621
- return new RawSource(Generator.throwBuildErrorCode(error));
621
+ return new RawSource(
622
+ Generator.throwBuildErrorCode(
623
+ error,
624
+ undefined,
625
+ generateContext.runtimeTemplate.requestShortener
626
+ )
627
+ );
622
628
  }
623
629
  case CSS_TYPE: {
624
- return new RawSource(`/**\n ${error.message} \n**/`);
630
+ const message = Generator.buildErrorMessage(
631
+ error,
632
+ generateContext.runtimeTemplate.requestShortener
633
+ );
634
+
635
+ return new RawSource(`/**\n ${message} \n**/`);
625
636
  }
626
637
  default:
627
638
  return null;
@@ -1018,10 +1029,9 @@ class CssGenerator extends Generator {
1018
1029
  _cssToJsLiteral(cssSource, devtool, generateContext) {
1019
1030
  const { source, map } = cssSource.sourceAndMap();
1020
1031
  let content = /** @type {string} */ (source);
1021
- // A `renderEmbeddedSource` tap may hand back a mapped source whatever
1022
- // `devtool` says, so asking for no map at all is checked here too — this
1023
- // data URI would ship the sources inside the bundle. `hidden` is the same
1024
- // answer for the same reason.
1032
+ // A `renderEmbeddedSource` tap may return a mapped source whatever `devtool`
1033
+ // says, so wanting no map is checked here too: this data URI would ship the
1034
+ // sources inside the bundle. `hidden` answers the same.
1025
1035
  const wanted = typeof devtool === "string" && !devtool.includes("hidden");
1026
1036
  if (map && wanted) {
1027
1037
  const namedMap = this._nameMapSources(map, generateContext);
@@ -1082,11 +1092,9 @@ class CssGenerator extends Generator {
1082
1092
  result = cssSource;
1083
1093
  }
1084
1094
 
1085
- // Only text bound for a JS literal. `CSS_TEXT_TYPE` is an HTML inline
1086
- // `<style>` / `style=""`, and whether that is CSS at all depends on the
1087
- // element's `type` — a call the HTML layer makes and `htmlMinify` honors,
1088
- // which is not visible here. After the `@charset` prefix, so a tap sees a
1089
- // whole stylesheet.
1095
+ // Only text bound for a JS literal. Whether a `CSS_TEXT_TYPE` inline
1096
+ // `<style>` is CSS at all turns on the element's `type`, a call the HTML
1097
+ // layer makes. After the `@charset` prefix, so a tap sees a whole sheet.
1090
1098
  if (result && asJsLiteral) {
1091
1099
  result = this._renderEmbeddedSource(result, module, generateContext);
1092
1100
  }
@@ -164,13 +164,14 @@ const fontMimeType = (request) => {
164
164
  return getMimeTypes().lookup(resourcePath);
165
165
  };
166
166
 
167
- // Skip options for a non-CSS-Modules parse: drop the selector prelude (never
168
- // walked without modules) plus value / function-arg leaves nothing reads (the
169
- // `Ident` visitor no-ops, the `Declaration` visitor returns early, no ICSS).
170
- // `url` / functions / strings / blocks / commas are kept — they carry url()
171
- // rewrites and image-set fences. At-rule preludes are kept (`@media` / `@import`
172
- // are read). CSS-Modules parses skip nothing: selectors are walked and ICSS
173
- // `:export { k: v }` captures each value's byte range from its first / last node.
167
+ // WHY: skip options for a non-CSS-Modules parse. The selector prelude is never
168
+ // walked without modules, and the value and function-arg leaves reach nothing —
169
+ // the `Ident` visitor no-ops, the `Declaration` visitor returns early, and there
170
+ // is no ICSS. `url`, functions, strings, blocks and commas are kept, carrying
171
+ // the `url()` rewrites and image-set fences, and at-rule preludes too, since
172
+ // `@media` and `@import` are read. A CSS-Modules parse skips nothing: selectors
173
+ // are walked, and ICSS `:export { k: v }` captures each value's byte range from
174
+ // its first and last node.
174
175
  const SKIP_NON_MODULES = {
175
176
  types: buildSkipSet([
176
177
  NodeType.Number,
@@ -4814,13 +4815,13 @@ class CssParser extends Parser {
4814
4815
  },
4815
4816
  [NodeType.Ident](path) {
4816
4817
  const node = path.node;
4817
- // Fast exit before slicing the ident value: outside dashed-ident scoping
4818
- // and ICSS context (any non-CSS-Modules stylesheet) a bare ident carries
4819
- // no work, and idents are the most common node, so skipping the per-ident
4820
- // `value` slice matters. With no `@value`/`:import` definitions the ICSS
4821
- // probe can never hit, so it doesn't warrant the slice either. The dashed
4822
- // probe reads two char codes instead of slicing (escaped dashes don't
4823
- // match, same as the string form — cf. `processDashedIdentInVarFunction`).
4818
+ // WHY: a fast exit before slicing the ident value. Outside dashed-ident
4819
+ // scoping and ICSS context — any non-CSS-Modules stylesheet — a bare
4820
+ // ident carries no work, and idents are the most common node, so skipping
4821
+ // the per-ident `value` slice matters. With no `@value` or `:import`
4822
+ // definitions the ICSS probe can never hit, so it does not warrant the
4823
+ // slice either. The dashed probe reads two char codes instead of slicing,
4824
+ // and an escaped dash does not match, as in the string form.
4824
4825
  const dashedActive = dashed.active;
4825
4826
  const icss = icssActive() && icssDefinitions.size !== 0;
4826
4827
  if (!dashedActive && !icss) return;
@@ -4915,12 +4916,9 @@ class CssParser extends Parser {
4915
4916
  emitICSSSymbol(identValue, identStart, identEnd);
4916
4917
  }
4917
4918
  };
4918
- // `as` selects the top-level production (§5.3): a `style` attribute is a
4919
- // block's contents, everything else a full stylesheet (the default). `as`
4920
- // and `skip` are per-parse config on the processor; only `locConverter`
4921
- // (per-source) is passed to `process`. One skip set: selector prelude +
4922
- // unread value leaves (non-modules only; CSS Modules needs its selectors
4923
- // and ICSS-captured values).
4919
+ // `as` selects the top-level production of §5.3: a `style` attribute is a
4920
+ // block's contents, anything else a full stylesheet. `as` and `skip` are
4921
+ // per-parse, so only the per-source `locConverter` reaches `process`.
4924
4922
  new SourceProcessor()
4925
4923
  .use(/** @type {VisitorMap} */ (visitors))
4926
4924
  .process(source, {
@@ -44,36 +44,40 @@ const cssMinify = async (input, sourceMap, minimizerOptions = {}) => {
44
44
 
45
45
  // TODO expose the remaining declined transforms on `optimization.minimize.css`
46
46
  // like `convertLengthUnits` — the switches below turn off what webpack does
47
- // make, not what it declines. Each is on in other minifiers; what each costs:
48
- // - dropping a declaration a later one overrides, which loses a fallback pair
49
- // an engine that cannot read the newer spelling depends on;
50
- // - merging rules a third stands between, and merging non-adjacent `@media`,
51
- // both of which reorder the cascade (csso loses ~12,900 Tailwind classes to
52
- // it). Adjacent rules sharing a block do join, nothing being between them to
53
- // step over — only where every selector is a shape each engine parses, since
54
- // one it cannot invalidates the whole list and loses the rest with it;
55
- // - the color conversions webpack declines rather than guesses. Every polar and
56
- // Lab function converts to hex, except two cases the other minifiers convert
57
- // regardless: a channel landing near a `.5` boundary, where implementations
58
- // round opposite ways (it is why esbuild and lightningcss emit different
59
- // bytes for `hwb(194 0% 0%)`), and a Lab-family color outside the sRGB gamut,
60
- // which hex would clip to a different color rather than respell.
61
- // Which longhand families merge into their shorthand is decided in
62
- // `tooling/generate-css-data.js`, and three kinds are excluded there for good
63
- // rather than pending an option:
64
- // - a shorthand gathering a whole family (`border`, `font`, `background`,
47
+ // make, not what it declines.
48
+
49
+ // WHY: each transform webpack declines is on in other minifiers, and each costs
50
+ // something measured.
51
+ // - Dropping a declaration a later one overrides loses a fallback pair an
52
+ // engine that cannot read the newer spelling depends on.
53
+ // - Merging rules a third stands between, and merging non-adjacent `@media`,
54
+ // both reorder the cascade (csso loses ~12,900 Tailwind classes to it).
55
+ // Adjacent rules sharing a block do join, nothing being between them to step
56
+ // over — only where every selector is a shape each engine parses, since one
57
+ // it cannot invalidates the whole list and loses the rest with it.
58
+ // - Two color conversions are declined rather than guessed. Every polar and Lab
59
+ // function converts to hex, except a channel landing near a `.5` boundary,
60
+ // where implementations round opposite ways (which is why esbuild and
61
+ // lightningcss emit different bytes for `hwb(194 0% 0%)`), and a Lab-family
62
+ // color outside the sRGB gamut, which hex would clip rather than respell.
63
+
64
+ // WHY: which longhand families merge into their shorthand is decided in
65
+ // `tooling/generate-css-data.js`, where three kinds are excluded for good
66
+ // rather than pending an option.
67
+ // - A shorthand gathering a whole family (`border`, `font`, `background`,
65
68
  // `transition`, `flex`, `columns`) resets longhands `computed` does not
66
69
  // name — `border` clears `border-image`, `font` clears `font-size-adjust` —
67
- // so the merge would drop a declaration nothing in the family wrote. The
68
- // ones checked against a browser and found to reset nothing else do merge
69
- // (`FAMILY_LONGHANDS`), where each value parses back into its own slot;
70
- // - a shorthand materially newer than its longhands (`place-items`/`-content`
70
+ // so the merge would drop a declaration nothing in the family wrote. The ones
71
+ // checked against a browser and found to reset nothing else do merge
72
+ // (`FAMILY_LONGHANDS`), where each value parses back into its own slot.
73
+ // - A shorthand materially newer than its longhands (`place-items`/`-content`
71
74
  // /`-self`) would lose both declarations, not one, on a target reading only
72
- // the longhands. `output.environment` states this for `inset` alone.
73
- // `overflow` is newer only two values wide, so it merges when it collapses;
74
- // - a pair two shorthands both claim, which cannot be right for both. None
75
+ // the longhands. `output.environment` states this for `inset` alone, and
76
+ // `overflow` is newer only two values wide, so it merges when it collapses.
77
+ // - A pair two shorthands both claim, which cannot be right for both. None
75
78
  // today: `mdn-data` gave `corner-inline-start-shape` the block-start edge's
76
79
  // corners, corrected in the generator to the pair Chromium computes.
80
+
77
81
  const {
78
82
  SourceProcessor,
79
83
  askEmbeddedRenderer,
@@ -84,10 +88,9 @@ const cssMinify = async (input, sourceMap, minimizerOptions = {}) => {
84
88
  const [[file, given]] = Object.entries(input);
85
89
  // The plugin hands a text minifier a string; the type admits an image's bytes.
86
90
  const code = typeof given === "string" ? given : given.toString("utf8");
87
- // `process` parses once, and with `mode: "minify"` the same walk also prints
88
- // the safely minified serialization — no second parse. Naming the input with
89
- // `source` / `content` is what asks for the map, which the plugin composes
90
- // back to the original source.
91
+ // `process` parses once, and under `mode: "minify"` the same walk prints the
92
+ // minified serialization too. Naming the input with `source` or `content` is
93
+ // what asks for the map the plugin composes back to the original.
91
94
  const {
92
95
  as,
93
96
  environment,