-
Notifications
You must be signed in to change notification settings - Fork 136
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
webpack2生成代码分析 #14
Comments
webpack2正式版本了啦? |
@lilijialiang beta版 |
想请问一下,webpack打包的代码中并没有调用__webpack_require__.n函数。该函数是被设计成在用户自己的模块中被调用的吗?如果是这样一般在什么场景下会用到该函数。 |
@lcxfs1991 似乎缺少spamain.js源码? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
原文链接
打包一个模块
整个立即执行函数,主要是webpack_require, webpack_require.n, webpack_require.d起作用。installedModules是用于缓存已经加载的模块。
异步加载
// result file, index.js
异步加载,主要是多了webpackJsonp全局函数,以及webpack_require.e作为加载script的函数。
CommonsChunkPlugin 提取公共包
提取公共包的这种情况,跟异步加载很类似,不过它将主要的功能函数都提取到common.js中,并且新增了执行module的逻辑。但主要入口的chunk都在主要逻辑的index.js与spa.js中。
webpack2使用了一些低端浏览器并不支持的接口,因此如果需要支持这些低端浏览器的业务,需要谨慎使用。
The text was updated successfully, but these errors were encountered: