mirror of
https://github.com/vuejs/babel-plugin-jsx.git
synced 2025-03-13 14:14:40 +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 = {
|
export type State = {
|
||||||
get: (name: string) => any;
|
get: (name: string) => any;
|
||||||
set: (name: string, value: any) => 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;
|
transformOn?: boolean;
|
||||||
|
/** enable optimization or not. */
|
||||||
optimize?: boolean;
|
optimize?: boolean;
|
||||||
|
/** merge static and dynamic class / style attributes / onXXX handlers */
|
||||||
mergeProps?: boolean;
|
mergeProps?: boolean;
|
||||||
|
/** configuring custom elements */
|
||||||
isCustomElement?: (tag: string) => boolean;
|
isCustomElement?: (tag: string) => boolean;
|
||||||
|
/** enable object slots syntax */
|
||||||
enableObjectSlots?: boolean;
|
enableObjectSlots?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { transform } from '@babel/core';
|
import { transform } from '@babel/core';
|
||||||
import JSX, { Opts } from '../src';
|
import JSX, { VueJSXPluginOptions } from '../src';
|
||||||
|
|
||||||
interface Test {
|
interface Test {
|
||||||
name: string;
|
name: string;
|
||||||
@ -7,7 +7,7 @@ interface Test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const transpile = (
|
const transpile = (
|
||||||
source: string, options: Opts = {},
|
source: string, options: VueJSXPluginOptions = {},
|
||||||
) => new Promise((resolve, reject) => transform(
|
) => new Promise((resolve, reject) => transform(
|
||||||
source,
|
source,
|
||||||
{
|
{
|
||||||
|
@ -4,11 +4,9 @@
|
|||||||
"rootDirs": ["./src"],
|
"rootDirs": ["./src"],
|
||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
"downlevelIteration": true,
|
"downlevelIteration": true,
|
||||||
"types": ["node", "jest"]
|
"types": ["node", "jest"],
|
||||||
|
"declaration": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": ["src/**/*", "global.d.ts"],
|
||||||
"src/**/*",
|
|
||||||
"global.d.ts"
|
|
||||||
],
|
|
||||||
"exclude": ["node_modules"]
|
"exclude": ["node_modules"]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user