webalys-hq / streamlinehq-npm

The deprecated Streamline NPM package, which will be deleted on 1st November 2022.
https://medium.com/streamline-icons/how-streamline-narrows-down-its-focus-eac6fdb5c6f2
24 stars 5 forks source link

How to use on Vercel #7

Closed marbiano closed 3 years ago

marbiano commented 3 years ago

Since streamlinehq.json is not supposed to be in the repo, deploying to Vercel fails because the build doesn't find the proper json config to add the streamline package.

Do you have a preferred workaround for this?

cbrwizard commented 3 years ago

I don't have experience with Vercel unfortunately. How do you think this should work? Is there a preconfig step there where you can manually upload a file? What do you thin about telling streamlinehq to read your project's .env file instead of streamlinehq.json? Would it solve your case?

marbiano commented 3 years ago

Putting config on .env would be ideal since that's the preferred way to handle this kind of stuff on Vercel.

marbiano commented 3 years ago

On Vercel itself you can easily set environment variables, .env file independent. Is there any way for the package to just read from the environment variables?

cbrwizard commented 3 years ago

The issue is that this package needs to read the parent project's env variables. If I add dotenv it will read its own env variables instead unfortunately (afaik). However, I can tell dotenv to read a file .env from the parent project folder https://github.com/motdotla/dotenv#path Do you think it will help? Or do you know a better way?

cbrwizard commented 3 years ago

Support for reading .env file or process.env has been added in 2.1.0 https://github.com/webalys-hq/streamlinehq-npm/releases/tag/2.1.0. Please update, hopefully it will solve your issue.