66 * found in the LICENSE file at https://angular.dev/license
77 */
88
9- import { isJsonObject , join , normalize } from '@angular-devkit/core' ;
9+ import { isJsonObject } from '@angular-devkit/core' ;
1010import {
1111 Rule ,
1212 SchematicContext ,
@@ -21,7 +21,7 @@ import {
2121 strings ,
2222 url ,
2323} from '@angular-devkit/schematics' ;
24- import { posix } from 'node:path' ;
24+ import { join } from 'node:path/posix ' ;
2525import { Schema as ServerOptions } from '../server/schema' ;
2626import {
2727 DependencyType ,
@@ -85,7 +85,7 @@ async function getApplicationBuilderOutputPaths(
8585
8686 let { outputPath } = architectTarget . options ;
8787 // Use default if not explicitly specified
88- outputPath ??= posix . join ( 'dist' , projectName ) ;
88+ outputPath ??= join ( 'dist' , projectName ) ;
8989
9090 const defaultDirs = {
9191 server : DEFAULT_SERVER_DIR ,
@@ -123,7 +123,7 @@ function addScriptsRule({ project }: SSROptions, isUsingApplicationBuilder: bool
123123 if ( isUsingApplicationBuilder ) {
124124 const { base, server } = await getApplicationBuilderOutputPaths ( host , project ) ;
125125 pkg . scripts ??= { } ;
126- pkg . scripts [ `serve:ssr:${ project } ` ] = `node ${ posix . join ( base , server ) } /server.mjs` ;
126+ pkg . scripts [ `serve:ssr:${ project } ` ] = `node ${ join ( base , server ) } /server.mjs` ;
127127 } else {
128128 const serverDist = await getLegacyOutputPaths ( host , project , 'server' ) ;
129129 pkg . scripts = {
@@ -185,7 +185,7 @@ function updateApplicationBuilderWorkspaceConfigRule(
185185 if ( outputPath . browser === '' ) {
186186 const base = outputPath . base as string ;
187187 logger . warn (
188- `The output location of the browser build has been updated from "${ base } " to "${ posix . join (
188+ `The output location of the browser build has been updated from "${ base } " to "${ join (
189189 base ,
190190 DEFAULT_BROWSER_DIR ,
191191 ) } ".
@@ -208,7 +208,7 @@ function updateApplicationBuilderWorkspaceConfigRule(
208208 outputPath,
209209 outputMode : 'server' ,
210210 ssr : {
211- entry : join ( normalize ( projectSourceRoot ) , 'server.ts' ) ,
211+ entry : join ( projectSourceRoot , 'server.ts' ) ,
212212 } ,
213213 } ;
214214 } ) ;
@@ -227,7 +227,7 @@ function updateWebpackBuilderWorkspaceConfigRule(
227227
228228 // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
229229 const serverTarget = project . targets . get ( 'server' ) ! ;
230- ( serverTarget . options ??= { } ) . main = posix . join ( projectSourceRoot , 'server.ts' ) ;
230+ ( serverTarget . options ??= { } ) . main = join ( projectSourceRoot , 'server.ts' ) ;
231231
232232 const serveSSRTarget = project . targets . get ( SERVE_SSR_TARGET_NAME ) ;
233233 if ( serveSSRTarget ) {
@@ -365,7 +365,7 @@ export default createProjectSchematic<SSROptions>(async (options, { project, tre
365365 const isStandalone = isStandaloneApp ( tree , browserEntryPoint ) ;
366366
367367 const usingApplicationBuilder = isUsingApplicationBuilder ( project ) ;
368- const sourceRoot = project . sourceRoot ?? posix . join ( project . root , 'src' ) ;
368+ const sourceRoot = project . sourceRoot ?? join ( project . root , 'src' ) ;
369369
370370 return chain ( [
371371 schematic ( 'server' , {
0 commit comments