Initial OSS commit
This commit is contained in:
commit
4a7303f40a
391 changed files with 245738 additions and 0 deletions
39
packages/playground/devEnv/servePlayground.ts
Normal file
39
packages/playground/devEnv/servePlayground.ts
Normal file
|
@ -0,0 +1,39 @@
|
|||
import path from 'path'
|
||||
import {
|
||||
convertObjectToWebpackDefinePaths,
|
||||
getEnvConfig,
|
||||
} from '../../../theatre/devEnv/webpack/createWebpackConfig'
|
||||
|
||||
const playgroundDir = path.join(__dirname, '..')
|
||||
|
||||
const envConfig = getEnvConfig(true)
|
||||
|
||||
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,
|
||||
define: {
|
||||
global: 'window',
|
||||
'$env.isCore': false,
|
||||
...convertObjectToWebpackDefinePaths({
|
||||
process: {env: envConfig},
|
||||
$env: envConfig,
|
||||
}),
|
||||
},
|
||||
},
|
||||
)
|
||||
.then((server: unknown) => {
|
||||
console.log('serving', 'http://localhost:' + port)
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue