Skip to content

Instantly share code, notes, and snippets.

@sibelius
Created January 18, 2019 13:44
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sibelius/baf12454c371e9d6c728376c39d9f1e0 to your computer and use it in GitHub Desktop.
Save sibelius/baf12454c371e9d6c728376c39d9f1e0 to your computer and use it in GitHub Desktop.
Webpack 4.23.0 patch to make import eager instead of lazy to make wp4 development mode faster
patch-package
--- a/node_modules/webpack/lib/dependencies/ImportParserPlugin.js
+++ b/node_modules/webpack/lib/dependencies/ImportParserPlugin.js
@@ -28,7 +28,8 @@ class ImportParserPlugin {
const param = parser.evaluateExpression(expr.arguments[0]);
let chunkName = null;
- let mode = "lazy";
+ // let mode = "lazy";
+ let mode = "eager";
let include = null;
let exclude = null;
const groupOptions = {};
@sibelius
Copy link
Author

this will backport this PR webpack/webpack#8645 to webpack 4

You should only apply this patch in development mode, not in production

npx patch-package to apply the patch

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