Fix issue window undefined error in bundled studio (#280)
* Fix issue window undefined error in bundled studio * Fix Studio.ts UI import
This commit is contained in:
parent
898c3b7a48
commit
dbe6a6176e
1 changed files with 5 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
import Scrub from '@theatre/studio/Scrub'
|
import Scrub from '@theatre/studio/Scrub'
|
||||||
import type {StudioHistoricState} from '@theatre/studio/store/types/historic'
|
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 type {Pointer} from '@theatre/dataverse'
|
||||||
import {Atom, PointerProxy, valueDerivation} from '@theatre/dataverse'
|
import {Atom, PointerProxy, valueDerivation} from '@theatre/dataverse'
|
||||||
import type {
|
import type {
|
||||||
|
@ -25,6 +25,9 @@ import checkForUpdates from './checkForUpdates'
|
||||||
|
|
||||||
export type CoreExports = typeof _coreExports
|
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:
|
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'
|
import studio from '@theatre/studio'
|
||||||
|
@ -96,7 +99,7 @@ export class Studio {
|
||||||
this.publicApi = new TheatreStudio(this)
|
this.publicApi = new TheatreStudio(this)
|
||||||
|
|
||||||
if (process.env.NODE_ENV !== 'test' && typeof window !== 'undefined') {
|
if (process.env.NODE_ENV !== 'test' && typeof window !== 'undefined') {
|
||||||
this.ui = new UI(this)
|
this.ui = new UIConstructor(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
this._attachToIncomingProjects()
|
this._attachToIncomingProjects()
|
||||||
|
|
Loading…
Reference in a new issue