Skip to content

Commit

Permalink
fix(build): add DOM purify optional default import to fix rollup builds
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Nov 19, 2021
1 parent fdc0fc4 commit 3bd335d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/binding/src/binding.service.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/services/utilities.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down

0 comments on commit 3bd335d

Please sign in to comment.