<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title>React Project</title> </head> <body> <script src="https://localhost:8080/webpack-dev-server.js"></script> <div></div> <script src="https://www.jb51.net/article/bundle.js"></script> </body> </html>
将上面的文件写好后并放到对应文件夹内运行命令npm run build dev,成功后浏览器访问地址location:8080,就会显示出对应界面
结果:
hello react&es2015&webpack!!!