chore: remove babelParserDefaultPlugins
The version of @babel/parser we are using now has these plugins enabled by default.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { parse } from '@babel/parser'
|
||||
import { babelParserDefaultPlugins } from '@vue/shared'
|
||||
import { transform } from '../src'
|
||||
|
||||
function assertCode(code: string) {
|
||||
@@ -7,7 +6,7 @@ function assertCode(code: string) {
|
||||
try {
|
||||
parse(code, {
|
||||
sourceType: 'module',
|
||||
plugins: [...babelParserDefaultPlugins, 'typescript']
|
||||
plugins: ['typescript']
|
||||
})
|
||||
} catch (e: any) {
|
||||
console.log(code)
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
walkFunctionParams
|
||||
} from '@vue/compiler-core'
|
||||
import { parse, ParserPlugin } from '@babel/parser'
|
||||
import { babelParserDefaultPlugins, hasOwn } from '@vue/shared'
|
||||
import { hasOwn } from '@vue/shared'
|
||||
|
||||
const TO_VAR_SYMBOL = '$'
|
||||
const TO_REF_SYMBOL = '$$'
|
||||
@@ -68,7 +68,7 @@ export function transform(
|
||||
|
||||
const ast = parse(src, {
|
||||
sourceType: 'module',
|
||||
plugins: [...new Set([...babelParserDefaultPlugins, ...plugins])]
|
||||
plugins
|
||||
})
|
||||
const s = new MagicString(src)
|
||||
const res = transformAST(ast.program, s)
|
||||
|
||||
Reference in New Issue
Block a user