I've an issue when i build styleguide "npx styleguidist build", i haven't this when i run "npx styleguidist server". In css file generated by styleguidist build, the link to fonts doesn't match with what is in build folder :
src:url(static/media/GothamRounded-Light.a6caeaca.woff2)
It works if i replace this url in css builded file by :
src:url(../media/GothamRounded-Light.a6caeaca.woff2)
See build folder's tree : picture of styleguidedist build's folders
styleguide.config.js :
const path = require('path')
const fs = require('fs');
module.exports = {
require: [
path.join(__dirname, 'src/assets/scss/app.scss'),
],
updateExample(props, exampleFilePath) {
const { settings, lang } = props
if (settings && typeof settings.file === 'string') {
const filepath = path.resolve(
path.dirname(exampleFilePath),
settings.file
)
const { file, ...restSettings } = settings
return {
content: fs.readFileSync(filepath, 'utf8'),
settings: restSettings,
lang
}
}
return props
},
sections: [
{
name: 'UI Components',
components: 'src/components/**/*.jsx',
exampleMode: 'collapse', // 'hide' | 'collapse' | 'expand'
usageMode: 'collapse', // 'hide' | 'collapse' | 'expand'
collapseCode: true,
}
],
}