And, See https://github.com/mrsteele/dotenv-webpack/blob/master/README.md. Yet another (not so popular) workaround is to use a webpack plugin: If you use craco (v6.3.0+), you just need to modify your craco.config.js file to add that plugin: For customize-cra users, see this answer or this github comment. I am building an Angular 7 app, and when i add a package npm install dragula --save and import this into the pollyfills.ts file i get this error: index.js:2 Uncaught ReferenceError: global is not However, now we want to also bundle our sass files through webpack is it simplifies our build process.it was going well, but now bundle.js is too big to deploy on production so I wanted to split bundle.js and styling files. You can use domino for such case. For TypeError: Illegal Invocation meaning: If you do not import Bootstrap via a