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 committed Sep 26, 2022
1 parent ed40a65 commit 1bac86a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 20 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
16 changes: 0 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1bac86a

Please sign in to comment.