From 589d3299ba07b9022ee553ff8c72d7f1bc8efcbc Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Wed, 11 Aug 2021 17:30:25 +0300 Subject: [PATCH] Remove dynamic import --- src/app/components/chart/chart.ts | 14 +++++--------- src/app/components/tsconfig.lib.json | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/app/components/chart/chart.ts b/src/app/components/chart/chart.ts index f9fa43149be..eb0572a8aaf 100755 --- a/src/app/components/chart/chart.ts +++ b/src/app/components/chart/chart.ts @@ -1,6 +1,6 @@ import {NgModule,Component,ElementRef,AfterViewInit,OnDestroy,Input,Output,EventEmitter,ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core'; import {CommonModule} from '@angular/common'; -import * as Chart from 'chart.js'; +import Chart from 'chart.js/auto'; @Component({ selector: 'p-chart', @@ -79,14 +79,10 @@ export class UIChart implements AfterViewInit, OnDestroy { opts.maintainAspectRatio = false; } - import('chart.js/auto').then((module) => { - if (module && module.default) { - this.chart = new module.default(this.el.nativeElement.children[0].children[0], { - type: this.type, - data: this.data, - options: this.options - }); - } + this.chart = new Chart(this.el.nativeElement.children[0].children[0], { + type: this.type, + data: this.data, + options: this.options }); } diff --git a/src/app/components/tsconfig.lib.json b/src/app/components/tsconfig.lib.json index c15adbab300..7e5e073af78 100644 --- a/src/app/components/tsconfig.lib.json +++ b/src/app/components/tsconfig.lib.json @@ -1,7 +1,7 @@ { "compilerOptions": { "declaration": true, - "module": "es2020", + "module": "es2015", "target": "es5", "baseUrl": ".", "stripInternal": true,