@@ -202,12 +202,19 @@ async function runEsbuild(
202202 throw new AbortedError ( '[angular-esbuild-adapter] Before building' ) ;
203203 }
204204
205- const projectRoot = path . dirname ( tsConfigPath ) ;
205+ const workspaceRoot = context . workspaceRoot ;
206+
207+ const projectMetadata = await context . getProjectMetadata (
208+ context . target . project ,
209+ ) ;
210+ const projectRoot = path . join (
211+ workspaceRoot ,
212+ ( projectMetadata [ 'root' ] as string | undefined ) ?? '' ,
213+ ) ;
214+
206215 const browsers = getSupportedBrowsers ( projectRoot , context . logger as any ) ;
207216 const target = transformSupportedBrowsersToTargets ( browsers ) ;
208217
209- const workspaceRoot = context . workspaceRoot ;
210-
211218 const optimizationOptions = normalizeOptimization (
212219 builderOptions . optimization ,
213220 ) ;
@@ -221,7 +228,7 @@ async function runEsbuild(
221228 await loadPostcssConfiguration ( searchDirectories ) ;
222229 const tailwindConfiguration = postcssConfiguration
223230 ? undefined
224- : await getTailwindConfig ( workspaceRoot , searchDirectories ) ;
231+ : await getTailwindConfig ( searchDirectories ) ;
225232
226233 const outputNames = {
227234 bundles : '[name]' ,
@@ -360,7 +367,6 @@ async function runEsbuild(
360367}
361368
362369async function getTailwindConfig (
363- workspaceRoot : string ,
364370 searchDirectories : { root : string ; files : Set < string > } [ ] ,
365371) : Promise < { file : string ; package : string } | undefined > {
366372 const tailwindConfigurationPath =
@@ -372,9 +378,7 @@ async function getTailwindConfig(
372378
373379 return {
374380 file : tailwindConfigurationPath ,
375- package : createRequire (
376- path . join ( workspaceRoot , tailwindConfigurationPath ) ,
377- ) . resolve ( 'tailwindcss' ) ,
381+ package : createRequire ( tailwindConfigurationPath ) . resolve ( 'tailwindcss' ) ,
378382 } ;
379383}
380384
0 commit comments