Polymer / polymer-project.org

Polymer Project site & blog.
https://www.polymer-project.org/
15 stars 13 forks source link

Minimal Getting Started with Material Components Web Components #85

Open gpmech opened 3 years ago

gpmech commented 3 years ago

I think there is a need for a minimal "Getting Started" with MWC Components. I'm just looking for how to get the following working, without the unpkg link. I've npm install'd mwc-button, but cannot run the minimal HTML below. Based on comments I've seen, this kind of example is whats holding people back.

<script type="module" src="node_modules/@material/mwc-button/mwc-button.js">
<mwc-button>Press Me!</mwc-button>

Even the example code given on the main part of the github page only works with es-dev-server --node-resolve. What about devs using other technologies (I used django) who want reusable web components, and don't want an unpkg link which may go away/ break compatibility in the future?

I would love a minimal example of compiling mwc-button (or any other mwc component) and then using it in an html page devoid of any special hosting requirements.

Thanks for making a great technology, I'd love to use it, just missing that last step!