简体   繁体   中英

Run ReactJS application which using webpack and babel without server and by opening HTML file

I couldn't find the proper answer for my problem so if there is any same question please let me know. I'm new in ReactJs and I was wondering if anyone could help me. I have the react project which is using Webpack to bundle components. It works fine with npm start on port 3000 but I need to run it without the server and I want to see it by opening the HTML file. The App just calls APIs in its components so it doesn't need the server. I have the same project and it works well but because it uses Webpack as well it's hard to find out what is missing in my project.

I would be grateful if anyone could help me!

Thanks

To generate an html file you can run npm run build that will generate all your static files in the build directory including a static html.

However i think you would still need a server to make async calls.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM