thgh / vercel-sapper

Vercel builder for Sapper with SSR enabled
MIT License
189 stars 25 forks source link

Need to serve statically a folder from `node_modules` #42

Closed madacol closed 4 years ago

madacol commented 4 years ago

I made a PR #41 that I think should solve this, but I'm not sure.

I'm using a package that has a folder with images that I want to serve statically.

I made a symbolic link from the static folder to the images folder, but it only works when I deploy from the CLI having that folder whitelisted in .vercelignore, but when deploying from github it fails to build because the folder node_modules does not exist

thgh commented 4 years ago

I don't think that Vercel supports symbolic links, you may get an answer sooner by asking here: https://github.com/vercel/vercel/discussions

Also, do you want the images statically hosted on the CDN or dynamically served through a Lambda?

madacol commented 4 years ago

Both options works for me, but at the CDN would be even better.

Thanks

thgh commented 4 years ago

How about copying the files on build through package.json? That will bake them into the lambda.

"scripts": {
  "build": "cp -R node_modules/somepkg static/somepkg; sapper build"
madacol commented 4 years ago

Thank you, never thought about that option