mrsteele / dotenv-webpack

A secure webpack plugin that supports dotenv and other environment variables and only exposes what you choose and use.
MIT License
1.3k stars 74 forks source link

How to set multiline variables? #494

Closed yxy9022 closed 1 year ago

yxy9022 commented 1 year ago

PUBLIC_KEY="-----BEGIN PUBLIC KEY----- ... p3V5fdWO18j... ... -----END PUBLIC KEY-----"

It doesn't seem to support。

mrsteele commented 1 year ago

Hi @jerry9022 , perhaps you didn’t read close enough but the readme actually shows an example: https://github.com/mrsteele/dotenv-webpack#create-a-env-file

Try that out!

yxy9022 commented 1 year ago

Sorry, I may have made a mistake. I originally meant "multiline values" like this: PRIVATE_ KEY="-----BEGIN RSA PRIVATE KEY----- ... Kh9NV... ... -----END RSA PRIVATE KEY-----" I read the dotenv library( https://www.npmjs.com/package/dotenv )Supported at 15.0.0+. The dependency dotenv you use is version 14. Maybe you need to make an upgrade。

mrsteele commented 1 year ago

@yxy9022 have you tried using a “\n” on a single line?

multiline, I can surely bump dotenv but of course that’s a little more involved 😊