bluewings/pug-as-jsx-loader

add option to support Mithril.js

Closed this issue · 1 comments

Now I edit the source of pug-as-jsx-utils and change in the index.js line 167
result.useFragment ? "import React, { Fragment } from 'react';" : "import React from 'react';",
to
result.useFragment ? "import m, { Fragment } from 'mithril';" : "import m from 'mithril';",
it can work, but I think it's better to expose an option, like
'@babel/plugin-transform-react-jsx', {"pragma": "m"}
it's more convenient and useful. May consider.

@Onesimu
Added pragma: 'preact' | 'mithril' option. Please upgrade to version 1.0.72, try it out and let me know if it works.

`import m from 'mithril';
export default function() {
return (
<div>
<h4>hello world</h4>
</div>
);
}
`, { pragma: 'mithril' }],