From abf98dfc1a4b397778fbb2a844706c2776f9789b Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Tue, 23 Feb 2021 17:06:25 -0500 Subject: [PATCH] Add support for static files to react-styleguidist --- styleguidist/styleguide.config.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/styleguidist/styleguide.config.js b/styleguidist/styleguide.config.js index de44a92..12e4a94 100644 --- a/styleguidist/styleguide.config.js +++ b/styleguidist/styleguide.config.js @@ -6,6 +6,15 @@ const path = require('path') module.exports = { + + /** + * Static assets folder. Accessible as / in the style guide dev server. + * @type {string | array} + * @example "/" + * @default undefined + */ + assetsDir: "assetsDir", + /** * The title that appears at the top of the navigation bar. * @type {string} @@ -119,7 +128,7 @@ module.exports = { */ getComponentPathLine(componentPath) { const name = path.basename(componentPath, '.js') - return `import ${name} from './components/${name}/';` + return `import ${name} from '../components/${name}/';` }, /**