Skip to content

Commit

Permalink
prefer optional chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
Lms24 committed Nov 28, 2023
1 parent 3f06531 commit 0a82e21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/astro/src/integration/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ function getSourcemapsAssetsGlob(config: AstroConfig): string {
// only copied over to <root>/.vercel. This seems to happen too late though.
// So we glob on both of these directories.
// Another case of "it ain't pretty but it works":(
if (config.adapter && config.adapter.name?.startsWith('@astrojs/vercel')) {
if (config.adapter?.name?.startsWith('@astrojs/vercel')) {
return '{.vercel,dist}/**/*';
}

// paths are stored as "file://" URLs
const outDirPathname = config.outDir && path.resolve(config.outDir.pathname);
const rootDirName = path.resolve((config.root && config.root.pathname) || process.cwd());
const rootDirName = path.resolve(config.root?.pathname || process.cwd());

if (outDirPathname) {
const relativePath = path.relative(rootDirName, outDirPathname);
Expand Down

0 comments on commit 0a82e21

Please sign in to comment.