Here is a repo I just created to get this issue solved: https://github.com/DevCubeHD/WebpackStaticPage
First of all: File structure. There are two important folders you should know to understand my example in case it isn't even convention. The /src
folder is where all the raw content goes and the /dist
folder is where the packed website goes by default. From there it is ready to deploy on any server. I'm not sure if development needs this directory anyways, but I hope you are.
I'm trying to set-up two webpack scripts for production and development.
Production works fine: The script runs trough and the page is put into /dist
.
In development I want to use webkit hotloader to instantly apply changes to the page just when I made some. It does run and the output seems very good, but when it comes to the page it stucks on [WDS] App hot update...
and does not update the content. Even after a refresh of the page the content is still the old. The only thing that helps is running the production script.
To run the development script use yarn start
or npm run start
. For a fresh /dist
directory you can use the production script yarn build
or npm run build
at the moment.
Please help me to fix the webback-dev-server so I can develop efficently. :) Thanks alot!