Skip to content

Commit 96c420b

Browse files
authored
Filter out node_modules (#346)
* Filter out node_modules * lint and update test * add comment
1 parent fc38e1d commit 96c420b

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@apphosting/adapter-nextjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@apphosting/adapter-nextjs",
3-
"version": "14.0.14",
3+
"version": "14.0.15",
44
"main": "dist/index.js",
55
"description": "Experimental addon to the Firebase CLI to add web framework support",
66
"repository": {

packages/@apphosting/adapter-nextjs/src/bin/build.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ metadata:
6262
adapterVersion: ${adapterMetadata.adapterVersion}
6363
framework: nextjs
6464
frameworkVersion: ${defaultNextVersion}
65+
outputFiles:
66+
serverApp:
67+
include:
68+
- .next/standalone
6569
`,
6670
};
6771
validateTestFiles(tmpDir, expectedFiles);

packages/@apphosting/adapter-nextjs/src/utils.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ async function moveResources(
151151
for (const path of pathsToMove) {
152152
const isbundleYamlDir = join(appDir, path) === dirname(bundleYamlPath);
153153
const existsInOutputBundle = await exists(join(outputBundleAppDir, path));
154-
if (!isbundleYamlDir && !existsInOutputBundle) {
154+
// Keep apphosting.yaml files in the root directory still, as later steps expect them to be there
155+
const isApphostingYaml = path === "apphosting_preprocessed" || path === "apphosting.yaml";
156+
if (!isbundleYamlDir && !existsInOutputBundle && !isApphostingYaml) {
155157
await move(join(appDir, path), join(outputBundleAppDir, path));
156158
}
157159
}
@@ -190,6 +192,11 @@ async function generateBundleYaml(
190192
framework: "nextjs",
191193
frameworkVersion: nextVersion,
192194
},
195+
outputFiles: {
196+
serverApp: {
197+
include: [".next/standalone"], // we're only including the standalone directory to exclude the node_modules folder specifically
198+
},
199+
},
193200
};
194201
await writeFile(opts.bundleYamlPath, yamlStringify(outputBundle));
195202
return;

0 commit comments

Comments
 (0)