question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reference to local files

See original GitHub issue

Hi,

How would one reference say some local .css file that’s located in dist folder next to my .storybook folder?

I’ve seen the examples of using head.html but every example has references to anything else but local files.

Br, Dan

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

19reactions
thani-shcommented, May 24, 2016

Hi Dan,

You can use the -s --static-dir argument to serve additional files. Try changing your npm script to something like this:

{
  ...
  "scripts": {
    "storybook": "start-storybook -p 9001 -s ./dist"
  }
  ...
}

dist/style.css should be available at http://localhost:9001/style.css

3reactions
lambert-velircommented, Nov 12, 2019

@mnmtanish Hi, I’m loading some external css and js in my preview-head.html like described above with --static-dir, and they’re loading great, with sourcemaps and everything!

However, storybook doesn’t reload when those files change. Is there a way to do that?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to properly reference local resources in HTML?
URLs will resolve to local resources only if the page was loaded from a local HTML file (usually expressed as a file://... URL)....
Read more >
Local files - Support - Spotify
Along with the millions of tracks we offer, the Local Files feature lets you use the Spotify app to play any other audio...
Read more >
Reference to local file doesn't work · Issue #65 - GitHub
I am playing around with references to local files and can't get it to work with the generator and referencing a yaml file....
Read more >
Can't get local file link in citation to work - TeX
The local file linking problem is a known issue in version 3.2 of SumatraPDF due to recent MuPDF changes. Currently it looks like...
Read more >
how to link to local file repository - Moodle.org
The current solution that I can think of would be to use the File resource. Within the File resource settings you can choose...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found