2021-06-18 13:05:06 +02:00
|
|
|
import path from 'path'
|
2021-06-18 21:03:44 +02:00
|
|
|
import {definedGlobals} from '../../../theatre/devEnv/buildUtils'
|
2021-06-18 13:05:06 +02:00
|
|
|
|
|
|
|
const playgroundDir = path.join(__dirname, '..')
|
|
|
|
|
|
|
|
const port = 8080
|
|
|
|
|
|
|
|
require('esbuild')
|
|
|
|
.serve(
|
|
|
|
{
|
|
|
|
port,
|
|
|
|
servedir: path.join(playgroundDir, 'src'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
entryPoints: [path.join(playgroundDir, 'src/index.tsx')],
|
|
|
|
target: ['firefox88'],
|
|
|
|
loader: {'.png': 'file'},
|
|
|
|
// outdir: '.',
|
|
|
|
// watch: true,
|
|
|
|
bundle: true,
|
|
|
|
sourcemap: true,
|
2021-06-18 21:03:44 +02:00
|
|
|
define: definedGlobals,
|
2021-06-18 13:05:06 +02:00
|
|
|
},
|
|
|
|
)
|
|
|
|
.then((server: unknown) => {
|
|
|
|
console.log('serving', 'http://localhost:' + port)
|
|
|
|
})
|