@@ -2,7 +2,7 @@ import fs from "fs";
2
2
import path from "path" ;
3
3
import crypto from "crypto" ;
4
4
import { globSync } from "glob" ;
5
- import { ComponentResourceOptions , Output , all } from "@pulumi/pulumi" ;
5
+ import { ComponentResourceOptions , Output , all , output } from "@pulumi/pulumi" ;
6
6
import { Size } from "../size.js" ;
7
7
import { Function } from "./function.js" ;
8
8
import {
@@ -470,17 +470,33 @@ export class Nextjs extends Component implements Link.Linkable {
470
470
const buildCommand = normalizeBuildCommand ( ) ;
471
471
const { sitePath, partition, region } = prepare ( args , opts ) ;
472
472
if ( $dev ) {
473
+ const server = createDevServer ( parent , name , args ) ;
473
474
this . registerOutputs ( {
474
475
_metadata : {
475
476
mode : "placeholder" ,
476
477
path : sitePath ,
477
- server : createDevServer ( parent , name , args ) . arn ,
478
+ server : server . arn ,
479
+ } ,
480
+ _receiver : {
481
+ directory : sitePath ,
482
+ links : output ( args . link || [ ] )
483
+ . apply ( Link . build )
484
+ . apply ( ( links ) => links . map ( ( link ) => link . name ) ) ,
485
+ aws : {
486
+ role : server . nodes . role . arn ,
487
+ } ,
488
+ environment : args . environment ,
478
489
} ,
479
490
_dev : {
480
491
directory : sitePath ,
481
- dev : {
482
- command : "npm run dev" ,
492
+ links : output ( args . link || [ ] )
493
+ . apply ( Link . build )
494
+ . apply ( ( links ) => links . map ( ( link ) => link . name ) ) ,
495
+ aws : {
496
+ role : server . nodes . role . arn ,
483
497
} ,
498
+ environment : args . environment ,
499
+ command : "npm run dev" ,
484
500
} ,
485
501
} ) ;
486
502
return ;
0 commit comments