/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
examples/html/src/index.html
46 строк
1 KB
Alexander Akait
feat(html): add module.parser.html.template option (#21055)
29 май 2026, 16:56
Не верифицирован
29 май 2026, 16:56
4fbec23
Код
Авторство
О чём код?
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>HTML modules</title> <!-- External stylesheet: goes through webpack's CSS pipeline and the emitted `.css` chunk is referenced here. --> <link rel="stylesheet" href="./styles.css" /> <!-- Inline <style>: bundled as a CSS module; its `url()` references become asset dependencies. --> <style> body { font-family: sans-serif; margin: 2rem; } </style> </head> <body> <h1>HTML modules</h1> <!-- Plain image source --> <img src="./logo.png" alt="logo" width="150" /> <!-- Responsive image: every candidate in `srcset` is bundled --> <img src="./logo.png" srcset="./logo.png 1x, ./logo@2x.png 2x" alt="responsive logo" width="150" /> <!-- External script: turned into a webpack entry, tag rewritten to the emitted bundle. This one imports an HTML module as a string (see app.js), so HTML-via-import is exercised without a JS entry point. --> <script src="./app.js"></script> <!-- Inline script: its body is bundled and the tag is rewritten to a `<script src>` pointing at the emitted chunk. --> <script> console.log("inline script, bundled by webpack"); </script> </body> </html>