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

index.html不引入bundle.js #6

Closed
GZWZC opened this issue Mar 29, 2017 · 6 comments
Closed

index.html不引入bundle.js #6

GZWZC opened this issue Mar 29, 2017 · 6 comments

Comments

@GZWZC
Copy link

GZWZC commented Mar 29, 2017

你好,我想问一下你,你的index.html里面没有引入webpack打包后的bundle.js,那你是如何启动项目的

@hechuanhua
Copy link
Owner

目前如果是生产环境的话还有问题,正在修复,但是如果是开发的话是没问题的

@GZWZC
Copy link
Author

GZWZC commented Mar 29, 2017

@hechuanhua 但是我看你线上是没有问题的,

@GZWZC
Copy link
Author

GZWZC commented Mar 29, 2017

@hechuanhua 还有 我想问一下
我有一个项目,entry入口,有8个路由页面,我没有用按需加载的时候直接在index.html里引入bundle.js,bundle.js大小为2.8M。
如果我用了按需加载后,我还需要在index.html引用bundle.js吗?如果不引用的话,页面没有加载任何js,如果引用了,network里的先加载bundle.js(2.2M),再引入对应页面的chunk.js。

这样是正常吗?

@hechuanhua
Copy link
Owner

线上暂时没有加服务端渲染,这个项目里面现在是加了服务端渲染的,如果是生产环境的话有点问题,正在开发

@hechuanhua
Copy link
Owner

你用了按需加载在主页肯定也要引入bundle,相当于主页的chunk就是bundle.js,然后你跳到其他的路由再去加载对应的chunk

@GZWZC
Copy link
Author

GZWZC commented Mar 29, 2017

好 谢谢 参考完你的webpack.config.js了 发现我没有利好用html-webpack-plugin

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