I have a litElement that I will need to consume from another domain. My browser is Chrome, I am using 'polymer serve' and navigating directly to the es5-bundle.
The lit-element is very simple. Just some static text.
When I use 'polymer build'
my entry HTML page gets compiled (or transformed). I see a reference to 'custom-elements-es5-adapter.js'
is added, as well as other custom JavaScript. When I navigate to this entry page (in the build folder) everything works. However, if I replace that compiled version with the original uncompiled version I get an error in the chrome console 'define is not defined'.
Eventually I will be calling this from another domain and will not be building the HTML it with polymer.(I have already tried it cross-domain and it's not working)
What do I need to include in the client to consume the polymer lit-element?
Here is what I have:
<body>
<my-element></my-element>
<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script type="module" src="./components/my-element.js" crossorigin=""?</script>
</body>