title: Override file in node_modules lib using webpack
body: <p>I have a <code>react</code> + <code>typescript</code> + <code>nextjs</code> project structure. It has 2 different projects, one is a utility library which is reusable across all the frontend project. I am using that utility library in my <code>react</code> + <code>typescript</code> + <code>NextJS</code> project as a dependency (added in <code>package.json</code>). The utility library has one default authentication function to check roles and permissions, and those roles and permissions differ for every other frontend project.</p>
  <p>Is there any way where I can override those authentication functions using webpack based on the frontend project (I can use environment variable to differentiate)?</p>