I created a new index.html as follows:
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<script src="bundle.js"></script>
</body>
</html>
at the same time, a new entry.js entry file is created as follows:
document.write("hello world.")
then execute $webpack entry.js bundle.js
seems to have succeeded!
but I found that there was nothing in bundle.js and nothing in the browser. Instead, a dist folder was generated with a mian.js
I modified index.html:
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<script src="dist/main.js"></script>
</body>
</html>
now the browser displays hello world
question:
Why didn"t you package the entry.js code into bundle.js as I expected?