--

I think this is exactly the kind of history that's a waste of time to learn, but you are right. When using webpack, I've rarely found a reason to use require, and IMO **** old code and bad patterns.

Here's a 2009 source citing require https://www.commonjs.org/specs/modules/1.0/ and another source that was hosted at MDN in 2016 https://developer.mozilla.org.cach3.com/en/JavaScript_code_modules/Using

For those who really care about the minutae here, please go read https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules

--

--

Dr. Derek Austin 🥳
Dr. Derek Austin 🥳

Written by Dr. Derek Austin 🥳

Hi, I'm Doctor Derek! I've been a professional web developer since 2005, and I love writing about programming with JavaScript, TypeScript, React, Next.js & Git.

Responses (1)