Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
January 18, 2022 04:09 am GMT

Quickest method to have webpack recompile your files

Just today I started noticing that when my react code rebuilds, I get eslint errors in the console, but not in my IDE.

Even stranger was the fact that when I run eslint by itself in the commandline, it doesn't show that anything was wrong:

eslint --cache --format stylish --ext '.js,.jsx,.ts,.tsx' --quiet ./

What gives?

Come On Reaction GIF

The solution

touch command to the rescue. In order to force webpack to recompile the files, they had to be changed somehow, and I wasn't prepared to manually change each file by hand, recompile, and revert the change, just to wait for another recompilation.

I simply used the touch command on Linux to "touch" all the files which were having that problem, like so:

touch src/pages/**/*.{js,jsx,tsx,ts}

shell is zsh

After running this command, webpack was forced to recompile everything and I no longer saw those pesky errors again.


Original Link: https://dev.to/smac89/quickest-method-to-cause-webpack-to-recompile-your-file-1l4e

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To