Skip to content

Commit

Permalink
feat(bootstrap): Add Dotenv support (#1158)
Browse files Browse the repository at this point in the history
  • Loading branch information
pan93412 authored Jul 9, 2023
1 parent 909902d commit 1736cd6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"author": "nondanee, 1715173329, pan93412",
"license": "LGPL-3.0-only",
"dependencies": {
"dotenv": "^16.3.1",
"node-windows": "^1.0.0-beta.8",
"pino": "6.14.0",
"pino-pretty": "^7.6.1"
Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const dotenv = require('dotenv');
const devMessage = require('./message');

/**
Expand All @@ -6,6 +7,9 @@ const devMessage = require('./message');
* @param {string} mainEntry
*/
function startApp(mainEntry) {
// Inject the `.env` file into the `process.env` object.
dotenv.config();

if (process.env.DEVELOPMENT === 'true') {
console.warn(devMessage);
// Require the source.
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1206,6 +1206,7 @@ __metadata:
browserslist: ^4.21.9
core-js: ^3.31.1
cross-env: ^7.0.3
dotenv: ^16.3.1
jest: ^29.6.1
node-windows: ^1.0.0-beta.8
pino: 6.14.0
Expand Down

0 comments on commit 1736cd6

Please sign in to comment.