Open
Description
I am trying to embed the JavaScript files into HTML file.
I have very simple example for test purposes
test.html
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="UTF-8">
</head>
<body>
<input type="button" value="SomeButton" onclick="testfn()">
<script src="script.js"></script>
</body>
</html>
script.js
function testfn()
{
alert("hello world");
}
I expect, that I provide the HTML file name into Webpack, the webpack will detect the JS file and will generate this output standalone HTML file:
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="UTF-8">
</head>
<body>
<input type="button" value="SomeButton" onclick="testfn()">
<script>
function testfn()
{
alert("hello world");
}
</script>
</body>
</html>
How to configure webpack to do this (package.json and webpack.config.js file)? I can not find, how to bundle such simple example.
The input HTML file is not an template. There is working page file.
Metadata
Metadata
Assignees
Labels
No labels