redom / redom

Tiny (2 KB) turboboosted JavaScript library for creating user interfaces.

Home Page:https://redom.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

redom is removed by babel when using jsx

syffs opened this issue · comments

commented

I'm using babel, typescript and webpack

here is a sample:

import * as redom from redom
class ButtonComponent {
el: HTMLElement
constructor() {
  // this.el = redom.el('button') // workaround
  this.el = (<button className="btn">Go</button>)
}
}

basically, redom is seen as unused import and gets purged by babel without the above workaround. Hence, it fails with error 'redom is not defined'.

any idea ?

You should probably create babel issue instead 🤔