mirror of
https://github.com/vuejs/babel-plugin-jsx.git
synced 2024-11-10 09:39:14 +08:00
feat: export interface VueJSXPluginOptions
This commit is contained in:
parent
764afcdb3c
commit
689ceea4c0
@ -10,14 +10,19 @@ import sugarFragment from './sugar-fragment';
|
||||
export type State = {
|
||||
get: (name: string) => any;
|
||||
set: (name: string, value: any) => any;
|
||||
opts: Opts;
|
||||
opts: VueJSXPluginOptions;
|
||||
}
|
||||
|
||||
export interface Opts {
|
||||
export interface VueJSXPluginOptions {
|
||||
/** transform `on: { click: xx }` to `onClick: xxx` */
|
||||
transformOn?: boolean;
|
||||
/** enable optimization or not. */
|
||||
optimize?: boolean;
|
||||
/** merge static and dynamic class / style attributes / onXXX handlers */
|
||||
mergeProps?: boolean;
|
||||
/** configuring custom elements */
|
||||
isCustomElement?: (tag: string) => boolean;
|
||||
/** enable object slots syntax */
|
||||
enableObjectSlots?: boolean;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { transform } from '@babel/core';
|
||||
import JSX, { Opts } from '../src';
|
||||
import JSX, { VueJSXPluginOptions } from '../src';
|
||||
|
||||
interface Test {
|
||||
name: string;
|
||||
@ -7,7 +7,7 @@ interface Test {
|
||||
}
|
||||
|
||||
const transpile = (
|
||||
source: string, options: Opts = {},
|
||||
source: string, options: VueJSXPluginOptions = {},
|
||||
) => new Promise((resolve, reject) => transform(
|
||||
source,
|
||||
{
|
||||
|
@ -4,11 +4,9 @@
|
||||
"rootDirs": ["./src"],
|
||||
"outDir": "dist",
|
||||
"downlevelIteration": true,
|
||||
"types": ["node", "jest"]
|
||||
"types": ["node", "jest"],
|
||||
"declaration": true
|
||||
},
|
||||
"include": [
|
||||
"src/**/*",
|
||||
"global.d.ts"
|
||||
],
|
||||
"include": ["src/**/*", "global.d.ts"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user