react-prism recommends to add a script tag directly in the HTML:
<script src="path/to/your/prism.js" ></script>
Is there a way to do this?
Yes, there is, but I don't think there's any docs on it yet. See #77.
Basically, create a head.html
in your .storybook
. That will get included.
_Note: This will add it to <head>
_
Thanks!
updating the answer: add a preview-head.html
to the folder .storybook
.
There doesn't seem to be a way to do this for local dependencies. What's the best way to get these into stories & the build output?
<script nomodule src="/dist/my-custom-script.js"></script>
Error: ENOENT: no such file or directory, stat '.../my-project/node_modules/@storybook/core/dist/public/dist/my-custom-script.js'
You can find the doc on the official website at this address: https://storybook.js.org/docs/configurations/add-custom-head-tags/
Most helpful comment
updating the answer: add a
preview-head.html
to the folder.storybook
.