chore: remove babelParserDefaultPlugins
The version of @babel/parser we are using now has these plugins enabled by default.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { parse, SFCScriptCompileOptions, compileScript } from '../src'
|
||||
import { parse as babelParse } from '@babel/parser'
|
||||
import { babelParserDefaultPlugins } from '@vue/shared'
|
||||
|
||||
export const mockId = 'xxxxxxxx'
|
||||
|
||||
@@ -20,7 +19,7 @@ export function assertCode(code: string) {
|
||||
try {
|
||||
babelParse(code, {
|
||||
sourceType: 'module',
|
||||
plugins: [...babelParserDefaultPlugins, 'typescript']
|
||||
plugins: ['typescript']
|
||||
})
|
||||
} catch (e: any) {
|
||||
console.log(code)
|
||||
|
||||
@@ -13,13 +13,7 @@ import {
|
||||
} from '@vue/compiler-dom'
|
||||
import { SFCDescriptor, SFCScriptBlock } from './parse'
|
||||
import { parse as _parse, ParserOptions, ParserPlugin } from '@babel/parser'
|
||||
import {
|
||||
babelParserDefaultPlugins,
|
||||
camelize,
|
||||
capitalize,
|
||||
generateCodeFrame,
|
||||
makeMap
|
||||
} from '@vue/shared'
|
||||
import { camelize, capitalize, generateCodeFrame, makeMap } from '@vue/shared'
|
||||
import {
|
||||
Node,
|
||||
Declaration,
|
||||
@@ -161,7 +155,7 @@ export function compileScript(
|
||||
scriptLang === 'tsx' ||
|
||||
scriptSetupLang === 'ts' ||
|
||||
scriptSetupLang === 'tsx'
|
||||
const plugins: ParserPlugin[] = [...babelParserDefaultPlugins]
|
||||
const plugins: ParserPlugin[] = []
|
||||
if (!isTS || scriptLang === 'tsx' || scriptSetupLang === 'tsx') {
|
||||
plugins.push('jsx')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user