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

我在使用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就直接进入呢?谢谢

巴扎黑
巴扎黑

reply all(0)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!