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

[框架工程项目] 10.Webpack 的代码分割,异步加载资源文件 #833

Open
qiilee opened this issue Nov 28, 2019 · 1 comment
Open

Comments

@qiilee
Copy link
Member

qiilee commented Nov 28, 2019

No description provided.

@yueshuai1992
Copy link

require.ensure方法:
在commonjs中有一个Modules/Async/A规范,里面定义了require.ensure语法。webpack实现了它,作用是可以在打包的时候进行代码分片,并异步加载分片后的代码。用法如下:

require.ensure([], function(require){
var list = require('./list');
list.show();
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants