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

Support multi-page app by marking html-webpack-plugin entries as lazy #3

Closed
haoqunjiang opened this issue Sep 7, 2019 · 2 comments
Closed

Comments

@haoqunjiang
Copy link

Currently, this plugin only deals with dynamic imports, but in real life, a common cause of slow compilation is huge multi-page apps (an example app: https://github.com/GodStream/multi-vue-cli3.0-bug).
By adding html-webpack-plguin entries to the lazyModules list, there will be great improvement to those apps. And this feature seems quite in line with this plugin's goal.

@JounQin
Copy link
Contributor

JounQin commented Nov 2, 2019

@liximomo

It starts with error after upgrading.

ERROR in   Error: webpack-internal:///./node_modules/lazy-compile-webpack-plugin/lib/loaders/api.js:22
  var originTitle = document.title;
                    ^
  ReferenceError: document is not defined
  
  - api.js:22 eval
    [.]/[lazy-compile-webpack-plugin]/lib/loaders/api.js:22:19
  
  - index.pug:108 Object../node_modules/lazy-compile-webpack-plugin/lib/loaders/api.js
    /Users/JounQin/Workspaces/GitHub/pkgr/packages/webpack/index.pug:108:1
  
  - index.pug:21 __webpack_require__
    /Users/JounQin/Workspaces/GitHub/pkgr/packages/webpack/index.pug:21:30
  
  - index.pug:3 eval
    [.]/[html-webpack-plugin]/lib/loader.js!./packages/webpack/index.pug:3:11
  
  - index.pug:97 Object../node_modules/html-webpack-plugin/lib/loader.js!./packages/webpack/index.pug
    /Users/JounQin/Workspaces/GitHub/pkgr/packages/webpack/index.pug:97:1
  
  - index.pug:21 __webpack_require__
    /Users/JounQin/Workspaces/GitHub/pkgr/packages/webpack/index.pug:21:30
  
  - index.pug:85 
    /Users/JounQin/Workspaces/GitHub/pkgr/packages/webpack/index.pug:85:18
  
  - index.pug:88 
    /Users/JounQin/Workspaces/GitHub/pkgr/packages/webpack/index.pug:88:10
  
  - index.js:247 HtmlWebpackPlugin.evaluateCompilationResult
    [pkgr]/[html-webpack-plugin]/index.js:247:28

@liximomo
Copy link
Owner

liximomo commented Nov 2, 2019

@JounQin Please go to #5

Repository owner locked as resolved and limited conversation to collaborators Nov 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants