How do I get Shoelace to work in an NPM + ESBuild project? #2010
-
I've wasted hours trying to figure it out. It took me a long while to understand that I am supposed to copy the assets manually into the static folder, but even with that, the styles aren't loading properly, and the button I am testing it on shows up unstyled. Does anybody have a simple project set up with ESBuild that I can study to see where I am going wrong? Despite how Shoelace looks like on the surface, it's very difficult to install. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
To add to that, if I try importing the autoloader version from the CDN, it doesn't work inside Lit elements. I finally got it to work only by loading the |
Beta Was this translation helpful? Give feedback.
-
Here's the simplest setup I could make using ESBuild + NPM. https://stackblitz.com/edit/esbuild-template-1szrrh?file=index.html |
Beta Was this translation helpful? Give feedback.
-
Thank you, I managed to figure out what my problem was thanks to the reference given by you. I wasn't importing the stylesheet like in your example, and once I did that everything started working. I didn't see that the bundler was outputting a css into the output folder. Today just wasn't my day. |
Beta Was this translation helpful? Give feedback.
Here's the simplest setup I could make using ESBuild + NPM.
https://stackblitz.com/edit/esbuild-template-1szrrh?file=index.html