Skip to content

Commit f960d77

Browse files
docs(css): say an HTTP charset outranks the written @charset
1 parent f5fc884 commit f960d77

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎declarations/WebpackOptions.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3109,7 +3109,7 @@ export interface Optimization {
31093109
*/
31103110
export interface OptimizationMinimizeCss {
31113111
/**
3112-
* How the minimizer states a `.css` asset's encoding. `"auto"` (the default) opens it with `@charset "UTF-8"` only when its output holds a non-ASCII character, so it is read as UTF-8 wherever it is served. `false` writes no `@charset` at all, and writes an escaped character past U+FFFF (an icon font's `content: "\F0A86"`) as the character itself, as `"auto"` does once that `@charset` is written. Set `false` only where the asset is read as UTF-8 anyway: a stylesheet with no `@charset` is read in the encoding the server's `Content-Type` names, else in the encoding of the page linking it, so it holds wherever the server names UTF-8 or the page is UTF-8 — and anywhere else every such character reads as other characters.
3112+
* How the minimizer states a `.css` asset's encoding. `"auto"` (the default) opens it with `@charset "UTF-8"` only when its output holds a non-ASCII character, so it is read as UTF-8 wherever the server's `Content-Type` names no other charset, which `@charset` cannot override. `false` writes no `@charset` at all, and writes an escaped character past U+FFFF (an icon font's `content: "\F0A86"`) as the character itself, as `"auto"` does once that `@charset` is written. Set `false` only where the asset is read as UTF-8 anyway: a stylesheet with no `@charset` is read in the encoding the server's `Content-Type` names, else in the encoding of the page linking it, so it holds wherever the server names UTF-8 or the page is UTF-8 — and anywhere else every such character reads as other characters.
31133113
* @since 5.112.0
31143114
*/
31153115
charset?: "auto" | false;

‎schemas/WebpackOptions.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4022,7 +4022,7 @@
40224022
"additionalProperties": false,
40234023
"properties": {
40244024
"charset": {
4025-
"description": "How the minimizer states a `.css` asset's encoding. `\"auto\"` (the default) opens it with `@charset \"UTF-8\"` only when its output holds a non-ASCII character, so it is read as UTF-8 wherever it is served. `false` writes no `@charset` at all, and writes an escaped character past U+FFFF (an icon font's `content: \"\\F0A86\"`) as the character itself, as `\"auto\"` does once that `@charset` is written. Set `false` only where the asset is read as UTF-8 anyway: a stylesheet with no `@charset` is read in the encoding the server's `Content-Type` names, else in the encoding of the page linking it, so it holds wherever the server names UTF-8 or the page is UTF-8 — and anywhere else every such character reads as other characters.",
4025+
"description": "How the minimizer states a `.css` asset's encoding. `\"auto\"` (the default) opens it with `@charset \"UTF-8\"` only when its output holds a non-ASCII character, so it is read as UTF-8 wherever the server's `Content-Type` names no other charset, which `@charset` cannot override. `false` writes no `@charset` at all, and writes an escaped character past U+FFFF (an icon font's `content: \"\\F0A86\"`) as the character itself, as `\"auto\"` does once that `@charset` is written. Set `false` only where the asset is read as UTF-8 anyway: a stylesheet with no `@charset` is read in the encoding the server's `Content-Type` names, else in the encoding of the page linking it, so it holds wherever the server names UTF-8 or the page is UTF-8 — and anywhere else every such character reads as other characters.",
40264026
"enum": ["auto", false],
40274027
"added": "5.112.0"
40284028
},

‎test/__snapshots__/Cli.basictest.js.snap‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11264,7 +11264,7 @@ Object {
1126411264
"optimization-minimize-css-charset": Object {
1126511265
"configs": Array [
1126611266
Object {
11267-
"description": "How the minimizer states a \`.css\` asset's encoding. \`\\"auto\\"\` (the default) opens it with \`@charset \\"UTF-8\\"\` only when its output holds a non-ASCII character, so it is read as UTF-8 wherever it is served. \`false\` writes no \`@charset\` at all, and writes an escaped character past U+FFFF (an icon font's \`content: \\"\\\\F0A86\\"\`) as the character itself, as \`\\"auto\\"\` does once that \`@charset\` is written. Set \`false\` only where the asset is read as UTF-8 anyway: a stylesheet with no \`@charset\` is read in the encoding the server's \`Content-Type\` names, else in the encoding of the page linking it, so it holds wherever the server names UTF-8 or the page is UTF-8 — and anywhere else every such character reads as other characters.",
11267+
"description": "How the minimizer states a \`.css\` asset's encoding. \`\\"auto\\"\` (the default) opens it with \`@charset \\"UTF-8\\"\` only when its output holds a non-ASCII character, so it is read as UTF-8 wherever the server's \`Content-Type\` names no other charset, which \`@charset\` cannot override. \`false\` writes no \`@charset\` at all, and writes an escaped character past U+FFFF (an icon font's \`content: \\"\\\\F0A86\\"\`) as the character itself, as \`\\"auto\\"\` does once that \`@charset\` is written. Set \`false\` only where the asset is read as UTF-8 anyway: a stylesheet with no \`@charset\` is read in the encoding the server's \`Content-Type\` names, else in the encoding of the page linking it, so it holds wherever the server names UTF-8 or the page is UTF-8 — and anywhere else every such character reads as other characters.",
1126811268
"multiple": false,
1126911269
"path": "optimization.minimize.css.charset",
1127011270
"type": "enum",
@@ -11274,7 +11274,7 @@ Object {
1127411274
],
1127511275
},
1127611276
],
11277-
"description": "How the minimizer states a \`.css\` asset's encoding. \`\\"auto\\"\` (the default) opens it with \`@charset \\"UTF-8\\"\` only when its output holds a non-ASCII character, so it is read as UTF-8 wherever it is served. \`false\` writes no \`@charset\` at all, and writes an escaped character past U+FFFF (an icon font's \`content: \\"\\\\F0A86\\"\`) as the character itself, as \`\\"auto\\"\` does once that \`@charset\` is written. Set \`false\` only where the asset is read as UTF-8 anyway: a stylesheet with no \`@charset\` is read in the encoding the server's \`Content-Type\` names, else in the encoding of the page linking it, so it holds wherever the server names UTF-8 or the page is UTF-8 — and anywhere else every such character reads as other characters.",
11277+
"description": "How the minimizer states a \`.css\` asset's encoding. \`\\"auto\\"\` (the default) opens it with \`@charset \\"UTF-8\\"\` only when its output holds a non-ASCII character, so it is read as UTF-8 wherever the server's \`Content-Type\` names no other charset, which \`@charset\` cannot override. \`false\` writes no \`@charset\` at all, and writes an escaped character past U+FFFF (an icon font's \`content: \\"\\\\F0A86\\"\`) as the character itself, as \`\\"auto\\"\` does once that \`@charset\` is written. Set \`false\` only where the asset is read as UTF-8 anyway: a stylesheet with no \`@charset\` is read in the encoding the server's \`Content-Type\` names, else in the encoding of the page linking it, so it holds wherever the server names UTF-8 or the page is UTF-8 — and anywhere else every such character reads as other characters.",
1127811278
"multiple": false,
1127911279
"simpleType": "string",
1128011280
},
@@ -12061,7 +12061,7 @@ Object {
1206112061
"optimization-minimize-options-css-charset": Object {
1206212062
"configs": Array [
1206312063
Object {
12064-
"description": "How the minimizer states a \`.css\` asset's encoding. \`\\"auto\\"\` (the default) opens it with \`@charset \\"UTF-8\\"\` only when its output holds a non-ASCII character, so it is read as UTF-8 wherever it is served. \`false\` writes no \`@charset\` at all, and writes an escaped character past U+FFFF (an icon font's \`content: \\"\\\\F0A86\\"\`) as the character itself, as \`\\"auto\\"\` does once that \`@charset\` is written. Set \`false\` only where the asset is read as UTF-8 anyway: a stylesheet with no \`@charset\` is read in the encoding the server's \`Content-Type\` names, else in the encoding of the page linking it, so it holds wherever the server names UTF-8 or the page is UTF-8 — and anywhere else every such character reads as other characters.",
12064+
"description": "How the minimizer states a \`.css\` asset's encoding. \`\\"auto\\"\` (the default) opens it with \`@charset \\"UTF-8\\"\` only when its output holds a non-ASCII character, so it is read as UTF-8 wherever the server's \`Content-Type\` names no other charset, which \`@charset\` cannot override. \`false\` writes no \`@charset\` at all, and writes an escaped character past U+FFFF (an icon font's \`content: \\"\\\\F0A86\\"\`) as the character itself, as \`\\"auto\\"\` does once that \`@charset\` is written. Set \`false\` only where the asset is read as UTF-8 anyway: a stylesheet with no \`@charset\` is read in the encoding the server's \`Content-Type\` names, else in the encoding of the page linking it, so it holds wherever the server names UTF-8 or the page is UTF-8 — and anywhere else every such character reads as other characters.",
1206512065
"multiple": false,
1206612066
"path": "optimization.minimizeOptions.css.charset",
1206712067
"type": "enum",
@@ -12071,7 +12071,7 @@ Object {
1207112071
],
1207212072
},
1207312073
],
12074-
"description": "How the minimizer states a \`.css\` asset's encoding. \`\\"auto\\"\` (the default) opens it with \`@charset \\"UTF-8\\"\` only when its output holds a non-ASCII character, so it is read as UTF-8 wherever it is served. \`false\` writes no \`@charset\` at all, and writes an escaped character past U+FFFF (an icon font's \`content: \\"\\\\F0A86\\"\`) as the character itself, as \`\\"auto\\"\` does once that \`@charset\` is written. Set \`false\` only where the asset is read as UTF-8 anyway: a stylesheet with no \`@charset\` is read in the encoding the server's \`Content-Type\` names, else in the encoding of the page linking it, so it holds wherever the server names UTF-8 or the page is UTF-8 — and anywhere else every such character reads as other characters.",
12074+
"description": "How the minimizer states a \`.css\` asset's encoding. \`\\"auto\\"\` (the default) opens it with \`@charset \\"UTF-8\\"\` only when its output holds a non-ASCII character, so it is read as UTF-8 wherever the server's \`Content-Type\` names no other charset, which \`@charset\` cannot override. \`false\` writes no \`@charset\` at all, and writes an escaped character past U+FFFF (an icon font's \`content: \\"\\\\F0A86\\"\`) as the character itself, as \`\\"auto\\"\` does once that \`@charset\` is written. Set \`false\` only where the asset is read as UTF-8 anyway: a stylesheet with no \`@charset\` is read in the encoding the server's \`Content-Type\` names, else in the encoding of the page linking it, so it holds wherever the server names UTF-8 or the page is UTF-8 — and anywhere else every such character reads as other characters.",
1207512075
"multiple": false,
1207612076
"simpleType": "string",
1207712077
},

‎types.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23640,7 +23640,7 @@ declare interface Optimization {
2364023640
*/
2364123641
declare interface OptimizationMinimizeCss {
2364223642
/**
23643-
* How the minimizer states a `.css` asset's encoding. `"auto"` (the default) opens it with `@charset "UTF-8"` only when its output holds a non-ASCII character, so it is read as UTF-8 wherever it is served. `false` writes no `@charset` at all, and writes an escaped character past U+FFFF (an icon font's `content: "\F0A86"`) as the character itself, as `"auto"` does once that `@charset` is written. Set `false` only where the asset is read as UTF-8 anyway: a stylesheet with no `@charset` is read in the encoding the server's `Content-Type` names, else in the encoding of the page linking it, so it holds wherever the server names UTF-8 or the page is UTF-8 — and anywhere else every such character reads as other characters.
23643+
* How the minimizer states a `.css` asset's encoding. `"auto"` (the default) opens it with `@charset "UTF-8"` only when its output holds a non-ASCII character, so it is read as UTF-8 wherever the server's `Content-Type` names no other charset, which `@charset` cannot override. `false` writes no `@charset` at all, and writes an escaped character past U+FFFF (an icon font's `content: "\F0A86"`) as the character itself, as `"auto"` does once that `@charset` is written. Set `false` only where the asset is read as UTF-8 anyway: a stylesheet with no `@charset` is read in the encoding the server's `Content-Type` names, else in the encoding of the page linking it, so it holds wherever the server names UTF-8 or the page is UTF-8 — and anywhere else every such character reads as other characters.
2364423644
* @since 5.112.0
2364523645
*/
2364623646
charset?: false | "auto";

0 commit comments

Comments
 (0)