Skip to content

Document .env files support #9

@michalkvasnicak

Description

@michalkvasnicak

Spust already supports .env and .env.local files. Each of the files is optional. They has to be in a root directory of a project.

If user wants to use them they work as following:

  1. file .env is loaded and parsed to variable (it is not assigned to process.env.* so it is not available in a configuration for example, see the last point)
  2. file .env.local is loaded and parsed to a variable, override previous values for intersected keys from .env file.
  3. all variables are available in your build as process.env.{name of variable} but they aren't available outside of the build. For example, you can't access them in spust.config.js. They are just interpolated using webpack.DefinePlugin()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions