webpack / webpack-cli

Webpack's Command Line Interface
https://webpack.js.org/api/cli
MIT License
2.56k stars 597 forks source link

implement built-in `.env` support #3747

Open alexander-akait opened 1 year ago

alexander-akait commented 1 year ago

I think we need to implement built-in .env support, there is a good plugin https://github.com/mrsteele/dotenv-webpack

Describe the solution you'd like

Allow to red env variables from .env file and control it using CLI option

Describe alternatives you've considered

No need

Additional context

No need

silverwind commented 1 year ago

How about supporting vite's files? I think multiple files are almost required if you have default vars checked in git and then have another file to override those vars at build time. If the same files as vite could be supported, it'd be some nice compatibilty.

alexander-akait commented 1 year ago

Yeah :+1:

mertcanaltin commented 1 year ago

@alexander-akait I want to do this 🚀 Would it be weird to add webpack config to the home directory? 🤔

webpack-bot commented 11 months ago

This issue had no activity for at least half a year.

It's subject to automatic issue closing if there is no activity in the next 15 days.

silverwind commented 11 months ago

@webpack-bot keep open.

webpack-bot commented 1 day ago

Issue was closed because of inactivity.

If you think this is still a valid issue, please file a new issue with additional information.