dev: Build playground files much faster and add watch

This commit is contained in:
Cole Lawrence 2022-06-15 14:23:26 -04:00
parent 2c2e421382
commit df692427ca
15 changed files with 460 additions and 278 deletions

View file

@ -1,3 +1,3 @@
import {createBundles} from './buildUtils'
import {createBundles} from './createBundles'
createBundles(false)

View file

@ -1,14 +1,6 @@
import path from 'path'
import {build} from 'esbuild'
export const definedGlobals = {
'process.env.THEATRE_VERSION': JSON.stringify(
require('../studio/package.json').version,
),
// json-touch-patch (an unmaintained package) reads this value. We patch it to just 'Set', becauce
// this is only used in `@theatre/studio`, which only supports evergreen browsers
'global.Set': 'Set',
}
import {definedGlobals} from './definedGlobals'
export function createBundles(watch: boolean) {
for (const which of ['core', 'studio']) {

View file

@ -0,0 +1,8 @@
export const definedGlobals = {
'process.env.THEATRE_VERSION': JSON.stringify(
require('../studio/package.json').version,
),
// json-touch-patch (an unmaintained package) reads this value. We patch it to just 'Set', becauce
// this is only used in `@theatre/studio`, which only supports evergreen browsers
'global.Set': 'Set',
}

View file

@ -1,3 +1,3 @@
import {createBundles} from './buildUtils'
import {createBundles} from './createBundles'
createBundles(true)