DEV Community

Cover image for Svelte + Tailwind + Storybook Starter Template

Svelte + Tailwind + Storybook Starter Template

Jerric Lyns John on September 01, 2019

This blog is pretty outdated and I've created an updated one here. Svelte ecosystem has matured a lot that, we really don't have to do a lot of co...
Collapse
 
smokeyfro profile image
Chris Rault

Anyone else getting "Uncaught SyntaxError: Unexpected token '<'" when trying to launch the Svelte app? I followed the instructions to a T and can see Storybook is working fine, but both the bundle.css and bundle.js are outputting the app's html.

Collapse
 
jerric profile image
Jerric Lyns John

Did you try running the code in the repo? Also can you share the error details?

Collapse
 
smokeyfro profile image
Chris Rault

Hi Jerric :) I decided to start over and the 2nd time round everything is working fine. Not sure where I went wrong before.

On an unrelated note, what would be the best way to add Sapper to the project? All the examples I've seen recommend starting with the Sapper template, but not anything about adding to existing templates.

TIA!

Thread Thread
 
jerric profile image
Jerric Lyns John

It can be done, but trust me going the template way is the best, you'll have to deal with both server side and client side dependencies. It's faster and straightforward with the template.

If you wanna add tailwind, just make sure you add the preprocess in both client and server side in the rollup config. To add story book it's the same process as mentioned in the blog here.

Collapse
 
codelitically_incorrect profile image
codelitically_incorrect

thanks, now i know to stay away from Svelte

Collapse
 
jerric profile image
Jerric Lyns John

I'm sure you'll be fine!!!

Collapse
 
willvincent profile image
Will Vincent

What's your problem with Svelte? Literally only one of the code blocks is svelte.. all the rest is the necessary config for storybook. If anything, you should be apprehensive of storybook.

Collapse
 
quantuminformation profile image
Nikos • Edited

Whats the best way to strip out the storybook stuff?

Wow, clone and installing gives

added 1417 packages from 1016 contributors and audited 30544 packages in 110.012s

Collapse
 
smokeyfro profile image
Chris Rault

Thanks Volmancer! I ended up rebuilding the project from scratch and everything is working second time round. Gotta love dev!

Thread Thread
 
jerric profile image
Jerric Lyns John

That's wierd, I'll check it out myself on a fresh instance.

Collapse
 
jerric profile image
Jerric Lyns John • Edited

This works pretty much without doing this as well! Must be system specific.