@@ -4,6 +4,7 @@ import { normalize, delimiter } from 'path'
44import { env } from 'process'
55import { fileURLToPath } from 'url'
66
7+ import { default as build , startDev } from '@netlify/build'
78import test from 'ava'
89import cpy from 'cpy'
910import { execa , execaCommand } from 'execa'
@@ -194,7 +195,6 @@ export class Fixture {
194195
195196 /** Runs @netlify/build main function programmatic with the provided flags */
196197 async runBuildProgrammatic ( ) : Promise < object > {
197- const { default : build } = await import ( '@netlify/build' )
198198 return await build ( this . getBuildFlags ( ) )
199199 }
200200
@@ -204,7 +204,6 @@ export class Fixture {
204204 }
205205
206206 async runWithBuildAndIntrospect ( ) {
207- const { default : build } = await import ( '@netlify/build' )
208207 const buildResult = await build ( this . getBuildFlags ( ) )
209208 const output = [ buildResult . logs ?. stdout . join ( '\n' ) , buildResult . logs ?. stderr . join ( '\n' ) ]
210209 . filter ( Boolean )
@@ -218,7 +217,6 @@ export class Fixture {
218217
219218 // TODO: provide better typing if we know what's possible
220219 async runDev ( devCommand : unknown ) : Promise < string > {
221- const { startDev } = await import ( '@netlify/build' )
222220 const entryPoint = startDev . bind ( null , devCommand )
223221 const { logs } = await entryPoint ( this . getBuildFlags ( ) )
224222 return [ logs . stdout . join ( '\n' ) , logs . stderr . join ( '\n' ) ] . filter ( Boolean ) . join ( '\n\n' )
0 commit comments