mirror of
https://github.com/vuejs/babel-plugin-jsx.git
synced 2025-07-05 11:33:30 +08:00
refactor: remove typescript
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@vue/babel-plugin-resolve-type",
|
||||
"version": "0.0.0",
|
||||
"description": "Babel plugin for resolving Vue types",
|
||||
"description": "Babel plugin for resolving Vue types.",
|
||||
"author": "三咲智子 <sxzz@sxzz.moe>",
|
||||
"homepage": "https://github.com/vuejs/babel-plugin-jsx/tree/dev/packages/babel-plugin-resolve-type#readme",
|
||||
"license": "MIT",
|
||||
@ -36,11 +36,11 @@
|
||||
"@babel/code-frame": "^7.22.10",
|
||||
"@babel/helper-module-imports": "^7.22.5",
|
||||
"@babel/parser": "^7.22.11",
|
||||
"@babel/plugin-syntax-typescript": "^7.22.5",
|
||||
"@vue/compiler-sfc": "npm:@vue/compiler-sfc-canary@minor"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.22.11",
|
||||
"@babel/plugin-syntax-typescript": "^7.22.5",
|
||||
"@types/babel__code-frame": "^7.0.3",
|
||||
"@types/babel__helper-module-imports": "^7.18.0",
|
||||
"vue": "^3.3.4"
|
||||
|
@ -1,7 +1,5 @@
|
||||
import type * as BabelCore from '@babel/core';
|
||||
import { parseExpression } from '@babel/parser';
|
||||
// @ts-expect-error no dts
|
||||
import typescript from '@babel/plugin-syntax-typescript';
|
||||
import {
|
||||
type SimpleTypeResolveContext,
|
||||
type SimpleTypeResolveOptions,
|
||||
@ -19,7 +17,6 @@ export default ({
|
||||
|
||||
return {
|
||||
name: 'babel-plugin-resolve-type',
|
||||
inherits: typescript,
|
||||
pre(file) {
|
||||
const filename = file.opts.filename || 'unknown.js';
|
||||
helpers = new Set();
|
||||
|
@ -1,9 +1,11 @@
|
||||
import { transformAsync } from '@babel/core';
|
||||
// @ts-expect-error missing types
|
||||
import typescript from '@babel/plugin-syntax-typescript';
|
||||
import ResolveType from '../src';
|
||||
|
||||
async function transform(code: string): Promise<string> {
|
||||
const result = await transformAsync(code, {
|
||||
plugins: [[ResolveType, { isTSX: true }]],
|
||||
plugins: [[typescript, { isTSX: true }], ResolveType],
|
||||
});
|
||||
return result!.code!;
|
||||
}
|
||||
|
Reference in New Issue
Block a user