Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
staticPath: resolveStaticPath(workDir, config),
basePath: workDir,
httpHost,
httpPort,
context,
project: sanityConfig.get('project')
}
checkStudioDependencyVersions(workDir)
let compileSpinner
const configSpinner = output.spinner('Checking configuration files...')
await tryInitializePluginConfigs({workDir, output, env: 'development'})
configSpinner.succeed()
const server = getDevServer(serverOptions)
const compiler = server.locals.compiler
// "invalid" doesn't mean the bundle is invalid, but that it is *invalidated*,
// in other words, it's recompiling
compiler.plugin('invalid', () => {
output.clear()
resetSpinner()
})
// Start the server and try to create more user-friendly errors if we encounter issues
try {
await promisify(server.listen.bind(server))(httpPort, httpHost)
} catch (err) {
gracefulDeath(httpHost, config, err)
}