@@ -15,7 +15,7 @@ import { NextConfigComplete } from "next/dist/server/config-shared.js";
1515import { OutputBundleConfig } from "@apphosting/common" ;
1616
1717// fs-extra is CJS, readJson can't be imported using shorthand
18- export const { copy, move , exists, writeFile, readJson, readdir, readFileSync, existsSync, mkdir } =
18+ export const { copy, exists, writeFile, readJson, readdir, readFileSync, existsSync, mkdir } =
1919 fsExtra ;
2020
2121// Loads the user's next.config.js file.
@@ -116,7 +116,7 @@ export function populateOutputBundleOptions(
116116}
117117
118118/**
119- * Moves static assets and other resources into the standlone directory, also generates the bundle.yaml
119+ * Copy static assets and other resources into the standlone directory, also generates the bundle.yaml
120120 * @param rootDir The root directory of the uploaded source code.
121121 * @param outputBundleOptions The target location of built artifacts in the output bundle.
122122 * @param nextBuildDirectory The location of the .next directory.
@@ -131,16 +131,16 @@ export async function generateBuildOutput(
131131) : Promise < void > {
132132 const staticDirectory = join ( nextBuildDirectory , "static" ) ;
133133 await Promise . all ( [
134- move ( staticDirectory , opts . outputStaticDirectoryPath , { overwrite : true } ) ,
135- moveResources ( appDir , opts . outputDirectoryAppPath , opts . bundleYamlPath ) ,
134+ copy ( staticDirectory , opts . outputStaticDirectoryPath , { overwrite : true } ) ,
135+ copyResources ( appDir , opts . outputDirectoryAppPath , opts . bundleYamlPath ) ,
136136 generateBundleYaml ( opts , rootDir , nextVersion , adapterMetadata ) ,
137137 ] ) ;
138138 return ;
139139}
140140
141- // Move all files and directories to apphosting output directory.
141+ // Copy all files and directories to apphosting output directory.
142142// Files are skipped if there is already a file with the same name in the output directory
143- async function moveResources (
143+ async function copyResources (
144144 appDir : string ,
145145 outputBundleAppDir : string ,
146146 bundleYamlPath : string ,
@@ -154,7 +154,6 @@ async function moveResources(
154154 // Keep apphosting.yaml files in the root directory still, as later steps expect them to be there
155155 const isApphostingYaml = path === "apphosting_preprocessed" || path === "apphosting.yaml" ;
156156 if ( ! isbundleYamlDir && ! existsInOutputBundle && ! isApphostingYaml ) {
157- //await move(join(appDir, path), join(outputBundleAppDir, path));
158157 await copy ( join ( appDir , path ) , join ( outputBundleAppDir , path ) ) ;
159158 }
160159 }
0 commit comments