Don't watch or inject live reload when running test server

This commit is contained in:
Catalin Constantin Mititiuc 2024-04-18 11:42:00 -07:00
parent 8e74cef4a5
commit c1f575a9c6

View File

@ -2,11 +2,15 @@ const { createServer } = require('esbuild-server');
const server = createServer( const server = createServer(
{ {
bundle: true, bundle: true,
entryPoints: ['src/index.js'], entryPoints: ['src/index.js']
}, },
{ {
static: 'public', static: 'public',
...(process.argv.slice(2).includes('--test')) && { port: 3005 } ...(process.argv.slice(2).includes('--test')) && {
port: 3005,
injectLiveReload: false,
watch: false
}
} }
); );