javascript - 关于使用react-hot-loader时,publicPath的问题
巴扎黑
巴扎黑 2017-04-11 11:45:19
0
0
296

我在使用react-hot-loader的时候,
我的项目目录结构:

---dist
    ---js
        ---bundle.js
    ---index.html
---src
    ---js
        ---app.js

然后我在index.html里引入的是最终打包文件./js/bundle.js
我的publicPath这样写的:

/dist/js

我这样就能够正常实时刷新,但是当我不写publicPath的时候,就不能随时刷新了,请问这是怎么回事呢?这个publicPath到底有什么作用呢?
我尝试在我的index.html文件里引入:localhost:3000/dist/js/bundle.js。发现会404

另外现在我必须得输入localhost:3000/index.html才能进入这个html文件,如何配置能输入localhost:3000就直接进入呢?谢谢

巴扎黑
巴扎黑

Antworte allen(0)
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!