Jackie
Jackie

Reputation: 23607

How do I import @material/mwc-button without precompiling?

I have the following code...

<html>
  <head></head>
  <body>
    <mwc-button label="Hello World"></mwc-button>
    <script src="https://unpkg.com/tslib/tslib.es6.js" type="module"></script>
    <script src="https://unpkg.com/@material/mwc-button/mwc-button.js" type="module"></script>
  </body>
</html>

But when I run I get...

Uncaught TypeError: Error resolving module specifier “tslib”. Relative module specifiers must start with “./”, “../” or “/”.

Now I know I can precompile and make a UMD but I really don't want to do that. Is there a way to trick the browser to just replacing the import string?

Upvotes: 1

Views: 159

Answers (0)

Related Questions