ArthurClemens / mithril-ts-vite-starter

Mithril with TypeScript starter template for Vite
17 stars 0 forks source link

TSX: 'm' is declared but its value is never read. #1

Open coderbuzz opened 2 years ago

coderbuzz commented 2 years ago

If using tsx, import m from "mithril";

caused: 'm' is declared but its value is never read.

coderbuzz commented 2 years ago

This can be solved using

jsxInject: "import m from 'mithril';"

in esbuild config:

esbuild: {
  jsx: "transform",
  jsxFactory: "m",
  jsxFragment: "'['",
  jsxInject: "import m from 'mithril';"
},