add option to support Mithril.js
Closed this issue · 1 comments
Onesimu commented
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.
bluewings commented
@Onesimu
Added pragma: 'preact' | 'mithril'
option. Please upgrade to version 1.0.72, try it out and let me know if it works.
pug-as-jsx-loader/test/issues.js
Lines 39 to 48 in 14259e7