vite-plugin-dom-jsx
Advanced tools
Comparing version 0.0.1-beta.1 to 0.0.1-beta.2
import { Plugin } from 'vite' | ||
declare function createPlugin(options?: {pragma: string, include: RegExp[]}): Plugin | ||
declare function createPlugin(options?: {pragma: string, include: RegExp[], importCode: string}): Plugin | ||
export default createPlugin |
12
index.js
@@ -13,7 +13,9 @@ const babel = require('@babel/core') | ||
function domJsxPlugin(options = { | ||
pragma: 'h', | ||
include: [/.\.tsx$/], | ||
}) { | ||
function domJsxPlugin(options = {}) { | ||
let needSourceMap = true | ||
options = Object.assign({}, { | ||
pragma: 'h', | ||
include: [/.\.tsx$/], | ||
importCode: `import {h} from 'tsx-dom';\n` | ||
}, options) | ||
@@ -66,3 +68,3 @@ return { | ||
return { | ||
code: result.code, | ||
code: importCode + result.code, | ||
map: result.map | ||
@@ -69,0 +71,0 @@ } |
{ | ||
"name": "vite-plugin-dom-jsx", | ||
"version": "0.0.1-beta.1", | ||
"version": "0.0.1-beta.2", | ||
"description": "a vite plugin which support tsx-dom library", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3757
68