@@ -20,14 +20,10 @@ const buildPreviewApp = (absoluteDirectory: string) => {
2020 return new Promise < void > ( ( resolve , reject ) => {
2121 const nextBuild = spawn ( 'npm' , [ 'run' , 'build' ] , {
2222 cwd : absoluteDirectory ,
23+ shell : true ,
2324 } ) ;
24-
25- nextBuild . stdout . on ( 'data' , ( msg : Buffer ) => {
26- process . stdout . write ( msg ) ;
27- } ) ;
28- nextBuild . stderr . on ( 'data' , ( msg : Buffer ) => {
29- process . stderr . write ( msg ) ;
30- } ) ;
25+ nextBuild . stdout . pipe ( process . stdout ) ;
26+ nextBuild . stderr . pipe ( process . stderr ) ;
3127
3228 nextBuild . on ( 'close' , ( code ) => {
3329 if ( code === 0 ) {
@@ -190,11 +186,11 @@ const npmInstall = async (
190186 return new Promise < void > ( async ( resolve , reject ) => {
191187 const childProc = spawn ( packageManager , [ 'install' , '--silent' ] , {
192188 cwd : builtPreviewAppPath ,
189+ shell : true ,
193190 } ) ;
194- childProc . stderr . on ( 'data' , ( chunk ) => {
195- process . stderr . write ( chunk ) ;
196- } ) ;
197- childProc . on ( 'exit' , ( code ) => {
191+ childProc . stdout . pipe ( process . stdout ) ;
192+ childProc . stderr . pipe ( process . stderr ) ;
193+ childProc . on ( 'close' , ( code ) => {
198194 if ( code === 0 ) {
199195 resolve ( ) ;
200196 } else {
@@ -240,9 +236,10 @@ export const build = async ({
240236 filter : ( source : string ) => {
241237 // do not copy the CLI files
242238 return (
243- ! source . includes ( '/cli/' ) &&
244- ! source . includes ( '/.next/' ) &&
245- ! / \/ n o d e _ m o d u l e s \/ ? $ / . test ( source )
239+ ! / ( \/ | \\ ) c l i ( \/ | \\ ) ? / . test ( source ) &&
240+ ! / ( \/ | \\ ) \. n e x t ( \/ | \\ ) ? / . test ( source ) &&
241+ ! / ( \/ | \\ ) \. t u r b o ( \/ | \\ ) ? / . test ( source ) &&
242+ ! / ( \/ | \\ ) n o d e _ m o d u l e s ( \/ | \\ ) ? $ / . test ( source )
246243 ) ;
247244 } ,
248245 } ) ;
0 commit comments