DEV Community

Cover image for Getting speed back, my Webpack debugging journey

Getting speed back, my Webpack debugging journey

John Hotterbeekx on November 11, 2018

I want to take you on a journey, through a land of slowness. Where everything lost its motivation to go fast, where hope seems lost. I want to take...
Collapse
 
alexbryant profile image
alexbryant

Hi John, can you expand on the steps you took here?

"With this in mind I looked at the webpack configuration and saw that js / jsx and ts / tsx files were not limited to a folder. That could mean that every module file is put through the loader. I updated the settings to make sure paths were defined where possible."

After exploring the webpack folders in node_modules I'm still unsure of where to find this configuration for js/jsx and ts/tsx, but if I did I am unsure of what exactly to limit it to - would it be limiting it to the src folder?

Thanks for your article!

Collapse
 
jhotterbeekx profile image
John Hotterbeekx

In the section Module / Loaders, you can either specify an include or exlude option to define which files it should process. What this should be depends on your folder structure, but usually setting it to only the 'src' folder is what I would recommend.

Collapse
 
alexbryant profile image
alexbryant

Great, thank you!

Collapse
 
janpauldahlke profile image
jan paul

Maybe this is mildly interesting for you:

dev.to/janpauldahlke/how-to-improv...

Its on TS an CRA, what is also webpack and how Treeshaking should/could be done. also check helpful comments

Collapse
 
jhotterbeekx profile image
John Hotterbeekx

Thanks for the article!

Collapse
 
david_j_eddy profile image
David J Eddy

"...software engineering to become a farmer..." If this does not happen at least once a week; you are not trying hard enough. :)

Great article John, I appreciate how you explained each step and the motivation and how you solved the issue. To few 'senior developers' can or do explain the mental steps taken to fix issues. PRefer to be 'magic' and 'amazing' rather than 'systematic' and 'inquisitive'.

Collapse
 
prog32 profile image
prog32

Thanks!

The key was to use: "--progress", to see what holds the build process.
Thanks to you I was able to reduced build time, even when SpeedMeasurePlugin didn't give any hint.