Skip to content

Commit

Permalink
Merge pull request #21 from grafikr/soft-config-missing
Browse files Browse the repository at this point in the history
Soften the "error" from missing config.yml
  • Loading branch information
andershagbard authored Sep 6, 2023
2 parents e69ad70 + 59f757b commit 477f902
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import getConfig from './util/get-config';
import getTarget from './util/get-target';

const config = getConfig();
const target = getTarget(config);
const target = config ? getTarget(config) : undefined;

const devServer = <Configuration>{
const devServer = config ? <Configuration>{
open: `?preview_theme_id=${config.theme_id}`,

devMiddleware: {
Expand Down Expand Up @@ -80,6 +80,6 @@ const devServer = <Configuration>{
},
},
},
};
} : undefined;

module.exports = devServer;
2 changes: 1 addition & 1 deletion src/util/get-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ export default () => {
return ConfigSchema.parse(data).development;
}

throw new Error('config.yml does not exists');
return null;
};

0 comments on commit 477f902

Please sign in to comment.