Describe the bug
We are unable to set a custom favicon for the storybook static build and development. We've tried using HtmlWebpackPlugin, setting the icon with different urls in the preview-header.html
and manager-header.html
having imported the 'favicon.ico' in the config.js
as follows:
import {
configure,
addParameters,
addDecorator
} from '@storybook/vue'
import {
Vue
} from 'vue-property-decorator'
import {
Centered
} from './components/centered'
import {
Installer
} from '../src/Installer'
import {
withKnobs
} from '@storybook/addon-knobs'
import '../src/assets/variables.css'
import '../src/assets/theme.css'
import '../src/assets/base.css'
import '../src/sass/main.scss'
import {
withInfo
} from 'storybook-addon-vue-info'
// We import the favicon here
import './favicon.ico'
Vue.component('Centered', Centered)
const installer = new Installer(Vue)
installer.install(true)
addParameters({
options: {
sortStoriesByKind: true
}
})
const stories = require.context('../src', true, /.stories.ts$/)
function loadStories() {
stories.keys().forEach(filename => stories(filename))
}
addDecorator(withKnobs)
addDecorator(withInfo)
configure(loadStories, module)
And the preview-header.html
(or manager-header.html
):
<link rel="shortcut icon" href="./favicon.ico">
We've tried these routes too:
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
And
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
Using the first option we see that the favicon is broken, however we don't see in the bundle the favicon.
System:
Here's my setup. First in package.json
scripts:
"storybook": "start-storybook -p 9009 -s public"
Then in .storybook/manager-head.html
(NOT manager-header.html
):
<link rel="shortcut icon" href="/storybook.ico">
<link rel="icon" type="image/png" href="/storybook.png" sizes="192x192">
Then in public
:
$ ls public/
storybook.ico storybook.png
Hope that helps!
My bad, I meant .storybook/manager-head.html
. Works perfectly now, thanks! Maybe adding this to the docs would help other people too 馃檪
Most helpful comment
Here's my setup. First in
package.json
scripts:Then in
.storybook/manager-head.html
(NOTmanager-header.html
):Then in
public
:Hope that helps!