Skip to content

Commit

Permalink
Merge pull request #398 from thusc/use-cwd-config
Browse files Browse the repository at this point in the history
Use the current working directory's config file.
  • Loading branch information
Wolfr authored Jul 14, 2021
2 parents a098863 + 385497f commit bcbeb83
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/discovery/config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
const path = require('path');

const defaultConfig = require('./default-config');

let config = {...defaultConfig};

try {
const projectConfig = require('../../bedrock.config');
const projectConfigPath = path.join(process.cwd(), 'bedrock.config');
const projectConfig = require(projectConfigPath);
config = {...config, ...projectConfig};
} catch (err) {
console.log(err);
Expand All @@ -13,7 +16,8 @@ try {

if (process.env.NODE_ENV == "production") {
try {
const projectConfig = require('../../bedrock.config.prod');
const projectConfigPath = path.join(process.cwd(), 'bedrock.config.prod');
const projectConfig = require(projectConfigPath);
config = {...config, ...projectConfig};
} catch (err) {
console.log(err);
Expand Down

0 comments on commit bcbeb83

Please sign in to comment.