histoire icon indicating copy to clipboard operation
histoire copied to clipboard

↗️ Auto "open browser" option

Open oneezy opened this issue 3 years ago • 3 comments
trafficstars

Clear and concise description of the problem

I want an option that will automatically open up the browser window when starting dev server or preview

I typically use --open in my package.json scripts but when trying to use this with Histoire it did not work.

Suggested solution

i.e.

  "scripts": {
    "story:dev": "histoire dev --port 6006 --open",
    "story:build": "histoire build",
    "story:preview": "histoire preview --port 6006 --open"
  },

Alternative

No response

Additional context

No response

Validations

oneezy avatar Aug 20 '22 18:08 oneezy

:laughing: , right after i submitted feature request i figured out how to do it.

Vite can do this easily from within the vite.config.js file

export default defineConfig({
  server: {
    open: '/' 
  }
})

https://vitejs.dev/config/server-options.html

oneezy avatar Aug 20 '22 18:08 oneezy

you may or may not want to reimplement this functionality for histoire so i'll leave open for now

oneezy avatar Aug 20 '22 18:08 oneezy

you may or may not want to reimplement this functionality for histoire so i'll leave open for now

Or document it on the histoire config page :)

Lyokolux avatar Oct 10 '22 13:10 Lyokolux