Skip to content

Commit

Permalink
refactor(vue-jsx): remove @babel/plugin-syntax-import-meta (#10233)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red authored Sep 26, 2022
1 parent 9ab7a94 commit 99e2d20
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion packages/plugin-vue-jsx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"homepage": "https://github.com/vitejs/vite/tree/main/packages/plugin-vue-jsx#readme",
"dependencies": {
"@babel/core": "^7.19.1",
"@babel/plugin-syntax-import-meta": "^7.10.4",
"@babel/plugin-transform-typescript": "^7.19.1",
"@vue/babel-plugin-jsx": "^1.1.1"
},
Expand Down
4 changes: 1 addition & 3 deletions packages/plugin-vue-jsx/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import path from 'node:path'
import type { types } from '@babel/core'
import * as babel from '@babel/core'
import jsx from '@vue/babel-plugin-jsx'
// @ts-expect-error missing type
import importMeta from '@babel/plugin-syntax-import-meta'
import { createFilter, normalizePath } from 'vite'
import type { ComponentOptions } from 'vue'
import type { Plugin } from 'vite'
Expand Down Expand Up @@ -83,7 +81,7 @@ function vueJsxPlugin(options: Options = {}): Plugin {
// use id for script blocks in Vue SFCs (e.g. `App.vue?vue&type=script&lang.jsx`)
// use filepath for plain jsx files (e.g. App.jsx)
if (filter(id) || filter(filepath)) {
const plugins = [importMeta, [jsx, babelPluginOptions], ...babelPlugins]
const plugins = [[jsx, babelPluginOptions], ...babelPlugins]
if (id.endsWith('.tsx') || filepath.endsWith('.tsx')) {
plugins.push([
// @ts-ignore missing type
Expand Down

0 comments on commit 99e2d20

Please sign in to comment.