Skip to content

Commit

Permalink
docs: Expounding upon how DefinePlugin actually works (#1709)
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian committed Aug 17, 2022
1 parent 6aba5d8 commit 1d53f26
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ console.log(process.env.PREACT_APP_MY_VARIABLE);

If your variable is not prefixed, you can still add it manually by using your `preact.config.js` (see [DefinePlugin] config in the recipes wiki).

It's important to note that `DefinePlugin` does direct text replacement; it does not make `process` usable. `process.env` could be an empty object, yet `process.env.PREACT_APP_MY_VARIABLE` will still get automatically replaced (if a value exists).

You can set and store variables using a `.env` file in the root of your project:

> `.env`
Expand Down

0 comments on commit 1d53f26

Please sign in to comment.