recently trying to use webpack to build a project, ask which library can implement the function of referencing the html module in the line of the html file?
at present, all I know is that the webpack template engine can do this kind of stitching. Can I write it directly into html?
Thank you!
for example:
a.html
<div class="blue-box">blue</div>
main.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Center</title>
</head>
<body>
// a.html
<div class="red-box">red</div>
</body>
</html>
result:
main.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Center</title>
</head>
<body>
<div class="blue-box">blue</div>
<div class="red-box">red</div>
</body>
</html>