Repository navigation
Commit 430bd41
authored
feat(css, html): extract license comments, and shorten CSS gradients and shadows (#22408)
* feat(css, html): extract license comments, and shorten CSS gradients and shadows
minimize.css.extractComments and minimize.html.extractComments take
terser's values and a { value, line, col } predicate, moving license
comments into [file].LICENSE.txt; HTML writes its banner as <!-- … -->
at the end of the document. CSS gradient directions, positions and
colors, and shadow colors, are written shorter.
* build(deps): bump minimizer-webpack-plugin to 5.13.0
Its formatBanner and getBannerPosition helpers let htmlMinify write the
extracted comments' banner as <!-- … --> at the end of the document.
* fix(types): keep minimizer-webpack-plugin's types out of the public declarations
Its types import webpack's own types.d.ts, so naming them in cssMinify,
htmlMinify or util.extractComments made every class appear twice to the
generator, which renamed them all. The plugin's extractComments is now
typed by what these minifiers read of it.
* fix(css): leave an invalid shadow layer as written
Dropping currentcolor or trailing zeros from a layer with two colors, too
many lengths, or lengths a color parts made a declaration the engine drops
valid. SHADOW_PROPERTIES now carries the grammar's length range, and the
rewrite runs only over layers already in shape. The equivalence helper's
gradient step also leaves strings and url() bodies alone.1 parent b17fa7d commit 430bd41
128 files changed
Lines changed: 1728 additions & 151 deletions
File tree
- .changeset
- declarations
- lib
- css
- html
- util
- schemas
- test
- __snapshots__
- configCases
- css
- compound-selector-digits
- escaped-property-names
- minify-at-rule-seam-order
- minify-at-rules-and-values
- minify-calc-number-outside
- minify-color-names
- minify-hoisted-nested-join
- minify-initial-keyword-engine-gap
- minify-layer-gather-large-block
- minify-light-dark-idempotent
- minify-light-dark-name-only
- minify-lowered-shorthand-dead-write
- minify-modern-longhands
- minify-nested-combinator
- minify-nested-idempotent
- minify-selectors-and-functions
- minify-value-keywords
- minimize-bad-string
- minimize-calc-lightningcss
- minimize-calc
- minimize-colors
- __snapshots__
- minimize-comments
- minimize-convert-approximate-colors
- minimize-convert-length-units
- minimize-cssnano-custom-properties
- minimize-dead-fallbacks-legacy
- minimize-dead-fallbacks
- minimize-dead-rules
- minimize-declined
- minimize-drop-dead-engine-rules
- minimize-drop-overridden-declarations
- minimize-embedded-data-url
- minimize-embedded-in-js
- minimize-embedded-nested-source-map
- minimize-empty-rules
- minimize-environment
- minimize-esbuild
- minimize-escaped-at-rule-names
- minimize-experiments-auto
- minimize-experiments-true
- minimize-extract-comments-options
- minimize-extract-comments
- minimize-light-dark
- minimize-lightningcss-selectors
- minimize-lightningcss-values
- __snapshots__
- minimize-lower-unsupported-off
- minimize-lower-unsupported
- minimize-media-queries
- minimize-merge-distant-rules
- minimize-merge-rules-order
- minimize-minimizer-detection
- minimize-nesting-lowered
- minimize-nesting
- minimize-pseudo-classes
- minimize-rewrite-custom-properties
- minimize-selectors
- minimize-shorthands
- minimize-source-map
- minimize-strings
- minimize-supports
- minimize-timing-functions
- minimize-transforms-off
- minimize-unused-symbols
- minimize-urls
- minimize-value-validity
- minimize-values
- minimize-vendor-prefixes-engine-switch
- minimize-vendor-prefixes-flexbox-2009
- minimize-vendor-prefixes-legacy-blink
- minimize-vendor-prefixes-legacy
- minimize-vendor-prefixes-logical
- minimize-vendor-prefixes-multicol
- minimize-vendor-prefixes-off
- minimize-vendor-prefixes
- minimize
- html
- minimize-comments-and-whitespace
- minimize-css-options
- minimize-embedded-nested
- minimize-embedded-script-productions
- minimize-empty-attributes
- minimize-empty-elements
- minimize-environment
- minimize-extract-comments-options
- minimize-extract-comments
- minimize-merge-styles
- minimize-redundant-attributes-all
- minimize-redundant-attributes
- minimize-srcdoc
- minimize-transforms-off
- optimization/minimize-css-only
- helpers
- unitCases
- tooling
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3148 | 3148 | | |
3149 | 3149 | | |
3150 | 3150 | | |
| 3151 | + | |
| 3152 | + | |
| 3153 | + | |
| 3154 | + | |
| 3155 | + | |
3151 | 3156 | | |
3152 | 3157 | | |
3153 | 3158 | | |
| |||
3250 | 3255 | | |
3251 | 3256 | | |
3252 | 3257 | | |
| 3258 | + | |
| 3259 | + | |
| 3260 | + | |
| 3261 | + | |
| 3262 | + | |
| 3263 | + | |
| 3264 | + | |
| 3265 | + | |
| 3266 | + | |
| 3267 | + | |
| 3268 | + | |
| 3269 | + | |
| 3270 | + | |
| 3271 | + | |
| 3272 | + | |
3253 | 3273 | | |
3254 | 3274 | | |
3255 | 3275 | | |
| |||
3275 | 3295 | | |
3276 | 3296 | | |
3277 | 3297 | | |
| 3298 | + | |
| 3299 | + | |
| 3300 | + | |
| 3301 | + | |
| 3302 | + | |
3278 | 3303 | | |
3279 | 3304 | | |
3280 | 3305 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
36 | | - | |
37 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
38 | 41 | | |
39 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
40 | 48 | | |
41 | 49 | | |
42 | 50 | | |
| |||
119 | 127 | | |
120 | 128 | | |
121 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
122 | 153 | | |
123 | 154 | | |
124 | 155 | | |
| |||
136 | 167 | | |
137 | 168 | | |
138 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
139 | 174 | | |
140 | | - | |
141 | | - | |
| 175 | + | |
| 176 | + | |
142 | 177 | | |
143 | 178 | | |
144 | 179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2034 | 2034 | | |
2035 | 2035 | | |
2036 | 2036 | | |
2037 | | - | |
2038 | | - | |
| 2037 | + | |
| 2038 | + | |
2039 | 2039 | | |
2040 | | - | |
2041 | | - | |
| 2040 | + | |
| 2041 | + | |
2042 | 2042 | | |
2043 | 2043 | | |
2044 | 2044 | | |
| |||
2920 | 2920 | | |
2921 | 2921 | | |
2922 | 2922 | | |
| 2923 | + | |
| 2924 | + | |
| 2925 | + | |
| 2926 | + | |
| 2927 | + | |
| 2928 | + | |
| 2929 | + | |
| 2930 | + | |
| 2931 | + | |
| 2932 | + | |
| 2933 | + | |
| 2934 | + | |
| 2935 | + | |
| 2936 | + | |
| 2937 | + | |
| 2938 | + | |
| 2939 | + | |
| 2940 | + | |
| 2941 | + | |
2923 | 2942 | | |
2924 | 2943 | | |
2925 | 2944 | | |
| |||
8180 | 8199 | | |
8181 | 8200 | | |
8182 | 8201 | | |
| 8202 | + | |
| 8203 | + | |
8183 | 8204 | | |
8184 | 8205 | | |
8185 | 8206 | | |
| |||
8201 | 8222 | | |
8202 | 8223 | | |
8203 | 8224 | | |
| 8225 | + | |
8204 | 8226 | | |
8205 | 8227 | | |
8206 | 8228 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7115 | 7115 | | |
7116 | 7116 | | |
7117 | 7117 | | |
7118 | | - | |
7119 | | - | |
| 7118 | + | |
| 7119 | + | |
| 7120 | + | |
7120 | 7121 | | |
7121 | 7122 | | |
7122 | 7123 | | |
| |||
15720 | 15721 | | |
15721 | 15722 | | |
15722 | 15723 | | |
15723 | | - | |
| 15724 | + | |
15724 | 15725 | | |
15725 | 15726 | | |
15726 | 15727 | | |
| |||
0 commit comments