mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-05 07:31:19 +08:00
Addon-docs: Fix main check for absolute config dirs
This commit is contained in:
parent
69dfe52e03
commit
741d501855
@ -23,7 +23,10 @@ export const verifyDocsBeforeControls = (addons: Entry[]) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const ensureDocsBeforeControls = (configDir: string) => {
|
export const ensureDocsBeforeControls = (configDir: string) => {
|
||||||
const mainFile = path.join(process.cwd(), configDir, 'main');
|
const mainFile = path.isAbsolute(configDir)
|
||||||
|
? path.join(configDir, 'main')
|
||||||
|
: path.join(process.cwd(), configDir, 'main');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line global-require,import/no-dynamic-require
|
// eslint-disable-next-line global-require,import/no-dynamic-require
|
||||||
const main = require(mainFile);
|
const main = require(mainFile);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user