97 likes
·
8.6K reads
11 comments
Excellent article. Thanks for sharing! Storybook FTW!
Thank you!
Dude, you're a life saver. Been through couple tutorials and yours gave me the Aha...moment. Excellent! Great job mate and thank you!!
Thanks Kutlwano. Glad you liked it!
Great blog!
Thanks Savio 😊
Love your tutorial, quick question: What is the difference between npm init @open-wc
and npx sb init -t web_components
?
As per my knowledge, npx sb init
can't be used in an empty project. @open-wc
is used to bootstrap an app just like create-react-app
for Reactjs. You can either add demoing storybook or once @open-wc
has generated an app, you can run npx sb init
inside it.
Can you explain how you can create an empty project such that npm init @open-wc will write into it and the rest of your tutorial can be followed?
Create an empty directory and just run
npm init @open-wc
inside it.
Piyush Sinha Thanks!
For any other js newbs, I had to do:
mkdir my-button && cd my-button
npm init @open-wc
And answer with (question 6 begins with this tutorial)
* What would you like to do today? › Scaffold a new project
* What would you like to scaffold? › Web Component
* What would you like to add? › Demoing (storybook)
* Would you like to use typescript? › No
* What is the tag name of your web component? › my-button
* Do you want to write this file structure to disk? › Yes
* Do you want to install dependencies? › Yes, with npm