Skip to content

Commit

Permalink
fix: strip optional import to avoid webpack bug
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Jun 7, 2024
1 parent 3cf8e39 commit 472c59d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/schema-record/src/record.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { dependencySatisfies, importSync } from '@embroider/macros';
import { dependencySatisfies, importSync, macroCondition } from '@embroider/macros';

import type { MinimalLegacyRecord } from '@ember-data/model/-private/model-methods';
import type Store from '@ember-data/store';
Expand Down Expand Up @@ -39,7 +39,7 @@ import {
} from './symbols';

const HAS_MODEL_PACKAGE = dependencySatisfies('@ember-data/model', '*');
const getLegacySupport = HAS_MODEL_PACKAGE
const getLegacySupport = macroCondition(dependencySatisfies('@ember-data/model', '*'))
? (importSync('@ember-data/model/-private') as typeof import('@ember-data/model/-private')).lookupLegacySupport
: null;

Expand Down

0 comments on commit 472c59d

Please sign in to comment.