Cannot GET / error running hello world in webpack
Turns out I had index.html in the wrong place. From the webpack docs:
To load your bundled files, you will need to create an index.html file in the build folder from which static files are served (--content-base option).
I made a copy of index.html in a new folder I called deployment
to match what I specified in the output.path
In webpack-dev-server documentation, there is an writeToDisk
option to solve this problem docs.
It will store all files on disk instead of memory.
Example from my config:
devServer: {
port: 3000,
writeToDisk: true,
proxy: {
'/': 'http://localhost:8080'
}
}
In the webpack.config.js
put this :
devServer: {
historyApiFallback: true,
}