I have a file structure as below:
Project
|
+-- src/
| |
| +-- index.js
|
+-- index.html
|
+-- webpack.config.js
src/index.js:
document.write("Hello World.");
index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>webpack learning</title>
<script src="builds/bundle.js"></script>
</head>
<body>
</body>
</html>
webpack.config.js:
var path = require('path');
module.exports = {
entry: './src',
output: {
path: path.join(__dirname, 'builds'),
filename: 'bundle.js',
}
};
When I run webpack-dev-server in the Project directory, webpack-dev-server starts normally and prints "webpack: bundle is now VALID." However, when I launch a browser and go to localhost:8080, the console complains that bundle.js is not found. Indeed, there is no such folder named "build" with bundle.js in it. But, isn't webpack-dev-server generating bundle.js in memory? Any configuration problems involved?