Skip to content

Commit

Permalink
Merge pull request #12873 from storybookjs/12872-essentials-absolute-…
Browse files Browse the repository at this point in the history
…config

Essentials: Fix absolute config dir
  • Loading branch information
shilman committed Oct 23, 2020
1 parent fb867b6 commit 231b6ae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion addons/essentials/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ interface PresetOptions {

const requireMain = (configDir: string) => {
let main = {};
const mainFile = path.join(process.cwd(), configDir, 'main');
const absoluteConfigDir = path.isAbsolute(configDir)
? configDir
: path.join(process.cwd(), configDir);
const mainFile = path.join(absoluteConfigDir, 'main');
try {
// eslint-disable-next-line global-require,import/no-dynamic-require
main = require(mainFile);
Expand Down

0 comments on commit 231b6ae

Please sign in to comment.