My file structure is:
dist
css
style.css
index.html
js
bundle.js
src
css
style.css
index.html
js
main.js
node_modules
webpack.con
Try this:
In your package.json
file, delete the line that contains "test" "echo \"Error: no test specified\" && exit 1"
under the scripts object, and replace it with:
...
"scripts": {
"start": "webpack-dev-server --hot"
},
...
Then to restart your project, just use npm start
.
This worked for me when I ran into this problem.
Edit: Can you share your package.json
file?
Try adding this to webpack.config.js as well
devServer: {
inline: true,
port: 3000,
hot: true
},