You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 153c222
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(html): drop with: { lang } for inline bodies
with is the import-attributes condition, so carrying an HTML lang there
misled. A lang body is matched by its mimetype alone: known languages as
their files' media type, any other as text/x-<lang>, which no built-in
rule's prefix catches; a lang no media type can name stays CSS or JS.
* Configure extraction of URL-like attribute values (e.g. `<img src>`, `<link href>`, `<script src>`) as webpack dependencies. `true` (default) uses the built-in source list; `false` disables extraction entirely so attributes are left untouched and `<script src>` / `<link rel="modulepreload">` / `<link rel="stylesheet">` no longer become compilation entries; an array lets you customize which `tag`/`attribute` pairs are treated as URLs and how they are bundled. Use the string `"..."` inside the array to inline the defaults. Inline `<script>` and `<style>` bodies are always processed; one whose `lang` names another language is a `data:` module typed as that language's files (`<style lang="scss">` as `text/x-scss`, `<script lang="ts">` as `text/typescript`), so a `mimetype` rule runs its loader, and `with: { lang }` matches the attribute as written. Use `webpackIgnore` comments or `IgnorePlugin` to skip individual URLs.
2044
+
* Configure extraction of URL-like attribute values (e.g. `<img src>`, `<link href>`, `<script src>`) as webpack dependencies. `true` (default) uses the built-in source list; `false` disables extraction entirely so attributes are left untouched and `<script src>` / `<link rel="modulepreload">` / `<link rel="stylesheet">` no longer become compilation entries; an array lets you customize which `tag`/`attribute` pairs are treated as URLs and how they are bundled. Use the string `"..."` inside the array to inline the defaults. Inline `<script>` and `<style>` bodies are always processed; one whose `lang` names another language is a `data:` module typed as that language's files (`<style lang="scss">` as `text/x-scss`, `<script lang="ts">` as `text/typescript`), and anything else as `text/x-<lang>`, so a `mimetype` rule runs its loader. Use `webpackIgnore` comments or `IgnorePlugin` to skip individual URLs.
2045
2045
*/
2046
2046
sources?:
2047
2047
|/** Sources to extract as webpack dependencies. Use `"..."` to inline the default source list. @minItems 1 */Array<
@@ -59,15 +59,13 @@ class HtmlInlineStyleDependency extends ModuleDependency {
59
59
* @param {boolean=} attribute true when the source is a `style="..."` attribute (a block's contents) rather than a `<style>` block (stylesheet)
60
60
* @param {boolean=} inAttribute true when the range is an attribute value (decoded on parse, so the processed CSS must be re-escaped on write-back); defaults to `attribute` — differs only for attribute values parsed as full stylesheets
61
61
* @param {boolean=} characterData true when the range is a `<style>` body in a foreign (SVG/MathML) subtree, where the content model is character data rather than raw text, so the processed CSS is escaped as text on write-back
62
-
* @param {string=} lang the `lang` a `<style>` body is written in, when not CSS (e.g. `scss`)
63
62
*/
64
63
constructor(
65
64
request,
66
65
range,
67
66
attribute=false,
68
67
inAttribute=attribute,
69
-
characterData=false,
70
-
lang=undefined
68
+
characterData=false
71
69
){
72
70
super(request);
73
71
this.range=range;
@@ -77,8 +75,6 @@ class HtmlInlineStyleDependency extends ModuleDependency {
77
75
this.inAttribute=inAttribute;
78
76
/** @type {boolean} */
79
77
this.characterData=characterData;
80
-
/** @type {string | undefined} */
81
-
this.lang=lang;
82
78
}
83
79
84
80
gettype(){
@@ -89,14 +85,6 @@ class HtmlInlineStyleDependency extends ModuleDependency {
Copy file name to clipboardExpand all lines: schemas/WebpackOptions.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -2532,7 +2532,7 @@
2532
2532
"added": "5.113.0"
2533
2533
},
2534
2534
"sources": {
2535
-
"description": "Configure extraction of URL-like attribute values (e.g. `<img src>`, `<link href>`, `<script src>`) as webpack dependencies. `true` (default) uses the built-in source list; `false` disables extraction entirely so attributes are left untouched and `<script src>` / `<link rel=\"modulepreload\">` / `<link rel=\"stylesheet\">` no longer become compilation entries; an array lets you customize which `tag`/`attribute` pairs are treated as URLs and how they are bundled. Use the string `\"...\"` inside the array to inline the defaults. Inline `<script>` and `<style>` bodies are always processed; one whose `lang` names another language is a `data:` module typed as that language's files (`<style lang=\"scss\">` as `text/x-scss`, `<script lang=\"ts\">` as `text/typescript`), so a `mimetype` rule runs its loader, and `with: { lang }` matches the attribute as written. Use `webpackIgnore` comments or `IgnorePlugin` to skip individual URLs.",
2535
+
"description": "Configure extraction of URL-like attribute values (e.g. `<img src>`, `<link href>`, `<script src>`) as webpack dependencies. `true` (default) uses the built-in source list; `false` disables extraction entirely so attributes are left untouched and `<script src>` / `<link rel=\"modulepreload\">` / `<link rel=\"stylesheet\">` no longer become compilation entries; an array lets you customize which `tag`/`attribute` pairs are treated as URLs and how they are bundled. Use the string `\"...\"` inside the array to inline the defaults. Inline `<script>` and `<style>` bodies are always processed; one whose `lang` names another language is a `data:` module typed as that language's files (`<style lang=\"scss\">` as `text/x-scss`, `<script lang=\"ts\">` as `text/typescript`), and anything else as `text/x-<lang>`, so a `mimetype` rule runs its loader. Use `webpackIgnore` comments or `IgnorePlugin` to skip individual URLs.",
2536
2536
"anyOf": [
2537
2537
{
2538
2538
"description": "Sources to extract as webpack dependencies. Use `\"...\"` to inline the default source list.",
0 commit comments