Skip to content

Conversation

@mnapoli
Copy link
Contributor

@mnapoli mnapoli commented Jan 14, 2022

Description

As mentioned in the discussion (#155 (comment)), Serverless Framework v2 and (upcoming) v3 support .env for ${env:xxx} variables via an option in the config.

That makes part of this plugin redundant. Especially since the plugin will no longer be able to load environment variables in the process.

However, this plugin is still useful to automatically inject all .env variables into functions.

So here is what we can do/recommend users:

  • to use ${env:xxx} with .env, use the native Serverless Framework feature
  • to import all .env variables into functions, use this plugin

See serverless/serverless#10495

I've updated the README to make this clearer. Let me know if that clarifies everything for v3?

@mnapoli
Copy link
Contributor Author

mnapoli commented Jan 31, 2022

@neverendingqs Since v3 was released last week would you have time to merge this pull request?

That would make upgrading more clear/easy for users.

@neverendingqs
Copy link
Owner

@neverendingqs Since v3 was released last week would you have time to merge this pull request?

That would make upgrading more clear/easy for users.

Sorry I will need to find time to take a look later. Initial thought is that this information should maybe go into a FAQ, since (I suspect) that adoption of v3 hasn't hit critical mass yet.

@mnapoli
Copy link
Contributor Author

mnapoli commented Jan 31, 2022

V3 usage is already at 17% of the whole userbase. It's growing very fast.

@mnapoli
Copy link
Contributor Author

mnapoli commented Mar 6, 2022

Hi @neverendingqs, quick reminder about this PR :)

Have a great weekend!

@shadrech
Copy link

On a side note, one feature which I think they should support for the useDotenv feature is the path option. This way we can dictate where the .env file can be to be used by the plugin. This is especially useful in monorepos as in my case

Copy link
Owner

@neverendingqs neverendingqs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey sorry finally got a chance to sit down and take a look.

mnapoli and others added 3 commits April 18, 2022 14:21
Co-authored-by: Mark Tse <[email protected]>
Co-authored-by: Mark Tse <[email protected]>
Co-authored-by: Mark Tse <[email protected]>
@neverendingqs neverendingqs merged commit 0a356ee into neverendingqs:master Apr 18, 2022
@neverendingqs neverendingqs changed the title Update the README for latest serverless v2 and upcoming v3 docs(readme): Update the README for latest serverless v2 and upcoming v3 Apr 18, 2022
@jayarjo
Copy link

jayarjo commented Jan 16, 2026

What about Serverless v4? This plugin is still very actual from what I see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants