You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/babel-plugin-transform-jsx-to-htm/README.md
+13-16Lines changed: 13 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# babel-plugin-transform-jsx-to-htm
2
2
3
-
This plugin converts JSX into Tagged Templates that work with things like [htm] and [lit-html].
3
+
This plugin converts JSX into Tagged Templates that work with [htm].
4
4
5
5
```js
6
6
// INPUT:
@@ -32,7 +32,8 @@ The following options are available:
32
32
33
33
| Option | Type | Default | Description
34
34
|--------|---------|----------|------------
35
-
| `tag` | String | `"html"` | The "tag" function to prefix [Tagged Templates] with.<br> _Useful when [Auto-importing a tag function](#auto-importing-the-tag)._
35
+
| `tag` | String | `"html"` | The "tag" function to prefix [Tagged Templates] with.
36
+
| `import` | `false`\|String\|Object | `false` | Auto-import a tag function, off by default.<br>_See [Auto-importing a tag function](#auto-importing-the-tag) for an example._
36
37
37
38
Options are passed to a Babel plugin using a nested Array:
38
39
@@ -46,29 +47,27 @@ Options are passed to a Babel plugin using a nested Array:
46
47
47
48
## Auto-importing the tag
48
49
49
-
Want to automatically import `html` into any file that uses JSX? It works the same as with JSX!
50
-
Just use [babel-plugin-jsx-pragmatic]:
50
+
Want to automatically import `html` into any file that uses JSX?
51
+
Just use the `import` option:
51
52
52
53
```js
53
54
"plugins": [
54
-
["babel-plugin-jsx-pragmatic", {
55
-
// the module to import:
56
-
"module":"lit-html",
57
-
// a named export to use from that module:
58
-
"export":"html",
59
-
// what to call it locally: (should match your "tag" option)
0 commit comments