DavidWells / analytics

Lightweight analytics abstraction layer for tracking page views, custom events, & identifying visitors

Home Page:https://getanalytics.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Angular warns about using "dlv" – can cause optimization bailouts

Pascalmh opened this issue · comments

When adding analytics to an angular project and running (ng serve) or building it (ng build) a warning is shown:

Warning: /node_modules/analytics-utils/dist/analytics-utils.module.js depends on 'dlv'. CommonJS or AMD dependencies can cause optimization bailouts.

I prepared a StackBlitz where I installed a new angular app and just added analytics + the google-analycics plugin.

To see the Warning just open the StackBlitz and check the Terminal, it should automatically run npm install && npm start - the Warning should be almost to the end of the output.

I think you need to add stuff to your build step to ignore warning https://stackoverflow.com/questions/62592903/upgrading-to-angular-10-fix-commonjs-or-amd-dependencies-can-cause-optimizatio

The code is very tiny and shouldn't cause any perf issues

@DavidWells yes, that's possible - (fyi: here's the official documentation on it).

However, the dlv-package states that it:

Supports ES Modules, CommonJS and globals.

So maybe it can be imported/implemented differently?