ProjectEvergreen / greenwood

Greenwood is your full-stack workbench for the web, focused on supporting modern web standards and development to help you create your next project.
https://www.greenwoodjs.io
MIT License
95 stars 9 forks source link

bug/check for api assets build output directory before copying for vercel adapter #1165

Closed thescientist13 closed 9 months ago

thescientist13 commented 9 months ago

Related Issue

Observed in https://github.com/thescientist13/greenwood-demo-adapter-vercel-lit/pull/7 that we need to check for public/api/assets directory before trying to copy, otherwise an error will occur

[Error: ENOENT: no such file or directory, lstat '/Users/owenbuckley/Workspace/github/greenwood-demo-adapter-vercel-lit/public/api/assets/'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'lstat',
  path: '/Users/owenbuckley/Workspace/github/greenwood-demo-adapter-vercel-lit/public/api/assets/'
}

This is being done in the [Netlify adapter](https://github.com/ProjectEvergreen/greenwood/blob/release/0.29.0/packages/plugin-adapter-netlify/src/index.js#L168( so seems like it was just something I missed for the Vercel one.

Summary of Changes

  1. Check for public/api/assets directory before trying to copy bundles
  2. Fix a variable typo in a console.warn in rollup.config.js