From b4aac604e569100f1a639301b2ee9411edea65a1 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Mon, 7 Sep 2020 13:18:01 -0400 Subject: [PATCH] Update component import lines in styleguidist --- styleguidist/styleguide.config.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/styleguidist/styleguide.config.js b/styleguidist/styleguide.config.js index 3a7c52b..bef947a 100644 --- a/styleguidist/styleguide.config.js +++ b/styleguidist/styleguide.config.js @@ -109,4 +109,16 @@ module.exports = { * @default false */ defaultExample: false, + + /** + * Returns the value of the import statement below a components name. + * @function + * @example import ItemTable from ./component/ItemTable/ + * @override + */ + getComponentPathLine(componentPath) { + const name = path.basename(componentPath, '.js') + const dir = path.dirname(componentPath) + return `import ${name} from '${dir}/';` + } } \ No newline at end of file