Addon-docs: Fix main check for absolute config dirs

This commit is contained in:
Michael Shilman 2020-08-16 20:50:14 +08:00
parent 69dfe52e03
commit 741d501855

View File

@ -23,7 +23,10 @@ export const verifyDocsBeforeControls = (addons: Entry[]) => {
};
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 {
// eslint-disable-next-line global-require,import/no-dynamic-require
const main = require(mainFile);