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

[webpack] 第2034天 在webpack中,如何做代码分割或者提取一个公共模块? #6000

Open
haizhilin2013 opened this issue Nov 8, 2024 · 1 comment
Labels

Comments

@haizhilin2013
Copy link
Collaborator

第2034天 在webpack中,如何做代码分割或者提取一个公共模块?

3+1官网

我也要出题

@Elylicery
Copy link

  1. 使用SplitChunksPlugin用于分割代码并提取公共模块
  2. 动态倒入import() 可以实现按需加载
    // 某个模块中
    import(/* webpackChunkName: "my-chunk-name" */ './myModule').then(module => {
    // 使用模块
    });

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

No branches or pull requests

2 participants