I was working on a project when I stumbled upon a weird problem where Webpack inserted some Javascripts into the compiled SCSS file. I thought I misconfigured something, turned out it was a bug with Webpack 4. I spent many hours debugging the problem, since there’s very few discussions and resources about this on Google (or perhaps I used the wrong keywords?), before I found this thread mentioning the problem was related to dynamic imports:

https://github.com/JeffreyWay/laravel-mix/issues/1976

Once I removed dynamic imports from my code, the problem was solved!

The good thing is, while browsing around the solutions for the problem, I found some pretty useful resources about Laravel Mix:

https://laravel-mix.com/

https://www.larashout.com/laravel-mix

There you go. I hope this post could save hours of your work.