I am building a webiste using Angular 2 with Visual Studio 2019 project template. I have been able to successfully publish it and it is working correctly in most browsers. I have been doing some testing using BrowserStack.com on different devices and found that in certain earlier versions of Safari and iOS I get an error in the console which prevents the page from loading completely. The error is as follows:
main-es5.4856ef6….js:1 TypeError: undefined is not a function (evaluating 'db(e,t)')
If I edit the .csproj file and build the project without the --prod parameter this error does not occur anymore at all. So I presume this is a problem in the minification of one of the Angular 2 dependencies.
How would I exclude this Angular dependency from the minification process but still allow my components and css to be minified or is there another solution? I tried to edit the .tsconfig file and added this to the excludes section but it did not work at all.
"exclude": [
"./dist/main-es2015.js",
"./dist/main-es5.js"
]
Any help or thoughts on this would be appreciated?