chore: fix typo for babelParserDefautPlugins (#1897)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { parse, SFCScriptCompileOptions, compileScript } from '../src'
|
||||
import { parse as babelParse } from '@babel/parser'
|
||||
import { babelParserDefautPlugins } from '@vue/shared'
|
||||
import { babelParserDefaultPlugins } from '@vue/shared'
|
||||
|
||||
function compile(src: string, options?: SFCScriptCompileOptions) {
|
||||
const { descriptor } = parse(src)
|
||||
@@ -12,7 +12,7 @@ function assertCode(code: string) {
|
||||
try {
|
||||
babelParse(code, {
|
||||
sourceType: 'module',
|
||||
plugins: [...babelParserDefautPlugins, 'typescript']
|
||||
plugins: [...babelParserDefaultPlugins, 'typescript']
|
||||
})
|
||||
} catch (e) {
|
||||
console.log(code)
|
||||
|
||||
@@ -2,7 +2,7 @@ import MagicString from 'magic-string'
|
||||
import { BindingMetadata } from '@vue/compiler-core'
|
||||
import { SFCDescriptor, SFCScriptBlock } from './parse'
|
||||
import { parse, ParserPlugin } from '@babel/parser'
|
||||
import { babelParserDefautPlugins, generateCodeFrame } from '@vue/shared'
|
||||
import { babelParserDefaultPlugins, generateCodeFrame } from '@vue/shared'
|
||||
import {
|
||||
Node,
|
||||
Declaration,
|
||||
@@ -58,7 +58,7 @@ export function compileScript(
|
||||
const isTS = scriptLang === 'ts' || scriptSetupLang === 'ts'
|
||||
const plugins: ParserPlugin[] = [
|
||||
...(options.babelParserPlugins || []),
|
||||
...babelParserDefautPlugins,
|
||||
...babelParserDefaultPlugins,
|
||||
...(isTS ? (['typescript'] as const) : [])
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user