Here I packaged my own vue project
react, and the same is true.
If I directly open the index.html below the packaged dist,
there will be a white screen problem such as resource not found or cross-domain.
This problem can actually be solved with nginx. But in fact, if It’s too troublesome just to test nginx
We can install an http-server terminal execution globally through the npm command
npm install -g http-server
After installing the dependencies, we open the command window as an administrator
, then go to the directory where we packaged
and enter the command in the terminal.
http-server -p 3000
Here we specify that it runs on port 3000. You can enter this port yourself.
Then at this time, I access the local 3000 port
http://localhost:3000/
Local projects started