From 3bd335dd62d0829c1581ca0fde560c93dcd84458 Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Thu, 18 Nov 2021 23:42:01 -0500 Subject: [PATCH] fix(build): add DOM purify optional default import to fix rollup builds --- packages/binding/src/binding.service.ts | 2 +- packages/common/src/services/utilities.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/binding/src/binding.service.ts b/packages/binding/src/binding.service.ts index f7a0c6d98..05ce9c25e 100644 --- a/packages/binding/src/binding.service.ts +++ b/packages/binding/src/binding.service.ts @@ -1,6 +1,6 @@ /* eslint-disable no-bitwise */ import * as DOMPurify_ from 'dompurify'; -const DOMPurify = DOMPurify_; // patch to fix rollup to work +const DOMPurify = (DOMPurify_ as any)['default'] || DOMPurify_; // patch to fix rollup to work interface Binding { variable: any; diff --git a/packages/common/src/services/utilities.ts b/packages/common/src/services/utilities.ts index cba5bd3df..b3e305e17 100644 --- a/packages/common/src/services/utilities.ts +++ b/packages/common/src/services/utilities.ts @@ -1,7 +1,7 @@ import { flatten } from 'un-flatten-tree'; import * as DOMPurify_ from 'dompurify'; import * as moment_ from 'moment-mini'; -const DOMPurify = DOMPurify_; // patch to fix rollup to work +const DOMPurify = (DOMPurify_ as any)['default'] || DOMPurify_; // patch to fix rollup to work const moment = (moment_ as any)['default'] || moment_; // patch to fix rollup "moment has no default export" issue, document here https://github.com/rollup/rollup/issues/670 import { Constants } from '../constants';