Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luo哥,怎么按需加载打包后的js代码啊?急求 #11

Closed
wangjunwei910208 opened this issue Feb 27, 2018 · 3 comments
Closed

Comments

@wangjunwei910208
Copy link

现在项目放到外网服务器之后,页面加载出来太慢,不知道怎么解决了

@javaLuo
Copy link
Owner

javaLuo commented Feb 27, 2018

可以用react-loadble (https://github.com/jamiebuilds/react-loadable)
专门用来做懒加载的。你把那些比较重量级的路由页面都配置一下,打包后就自动按需加载了。

@wangjunwei910208
Copy link
Author

我安装bundle-loader,按网上常用教程如:http://blog.csdn.net/qq_38054239/article/details/78844844 配置后,为啥Bundle.js一直报错啊

@javaLuo
Copy link
Owner

javaLuo commented Feb 28, 2018

你肯定哪里没写对吧
https://github.com/javaLuo/react-luo/tree/react-luo-webpack
这个里面我就是用bundle-loader配的代码分割,可以参考一下

@javaLuo javaLuo closed this as completed Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants