I am getting the following error when I try to serve my angular 6 application using cosmicjs:
Uncaught ReferenceError: process is not defined
at Object..
As long as you are not satisfied with putting some random logic into polyfills.ts and looking for a way to actually access the process.env in your Angular application please find below solution.
Change your "builder": "@angular-devkit/build-angular:dev-server" to "builder": "@angular-builders/custom-webpack:dev-server" in angular.json.