diff --git a/theatre/studio/src/Studio.ts b/theatre/studio/src/Studio.ts index 0c77dad..bd144fd 100644 --- a/theatre/studio/src/Studio.ts +++ b/theatre/studio/src/Studio.ts @@ -1,6 +1,6 @@ import Scrub from '@theatre/studio/Scrub' import type {StudioHistoricState} from '@theatre/studio/store/types/historic' -import UI from '@theatre/studio/UI' +import type UI from '@theatre/studio/UI' import type {Pointer} from '@theatre/dataverse' import {Atom, PointerProxy, valueDerivation} from '@theatre/dataverse' import type { @@ -25,6 +25,9 @@ import checkForUpdates from './checkForUpdates' export type CoreExports = typeof _coreExports +let {default: UIConstructor} = + typeof window !== 'undefined' ? require('./UI') : null + const STUDIO_NOT_INITIALIZED_MESSAGE = `You seem to have imported '@theatre/studio' but haven't initialized it. You can initialize the studio by: \`\`\` import studio from '@theatre/studio' @@ -96,7 +99,7 @@ export class Studio { this.publicApi = new TheatreStudio(this) if (process.env.NODE_ENV !== 'test' && typeof window !== 'undefined') { - this.ui = new UI(this) + this.ui = new UIConstructor(this) } this._attachToIncomingProjects()