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

Escape of shell special characters does not work properly #470

Closed AlexPalaz closed 2 years ago

AlexPalaz commented 3 years ago

I'm using "dotenv-webpack": "^1.8.0" My .env: API_CALL='https://api.call?\$language=en'

In the local environment it works correctly. Output:

https://api.call?$language=en

but when I build with webpack the result is:

https://api.call?\$language=en

What could be?

my webpack:

      new Dotenv({
          path: `./.env.${env.production ? 'production' : 'development'}`
      }),
      new webpack.DefinePlugin({
          "process.env.PRODUCTION": env.production || !env.development,
          "process.env.NAME": JSON.stringify(require("./package.json").name),
          "process.env.VERSION": JSON.stringify(require("./package.json").version),
      }),
mrsteele commented 3 years ago

Does it work when you just don't escape? I'm not sure I've run into this, but most likely because I'm not using these characters in ENVs I've worked with.

Happy to hear if the community has any recommendations as well.

mrsteele commented 2 years ago

Closing due to lack of participation and cannot reproduce.

Feel free to reopen this if you can provide more details, thanks.