Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

62
Vistas
Include imports from CDN into bundle with Rollup

How can I import external dependencies into my bundle with Rollup?

With the below example I would like to include lit-html into my bundle.

import { html, render } from 'https://cdn.skypack.dev/lit-html';
class extends HTMLElement {
    constructor() {
      super();
      this.attachShadow({ mode: 'open' });
      this.render();
    }
    render() {
      render(this.template, this.shadowRoot, { eventContext: this });
    }    
    get template() {
      return html`<h1>Hello, world</h1>`;
    }
}

7 months ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos