wip: compileScriptSetup
This commit is contained in:
@@ -31,8 +31,8 @@
|
||||
"homepage": "https://github.com/vuejs/vue-next/tree/master/packages/compiler-core#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.0.0-beta.20",
|
||||
"@babel/parser": "^7.8.6",
|
||||
"@babel/types": "^7.8.6",
|
||||
"@babel/parser": "^7.10.4",
|
||||
"@babel/types": "^7.10.4",
|
||||
"estree-walker": "^0.8.1",
|
||||
"source-map": "^0.6.1"
|
||||
}
|
||||
|
||||
@@ -22,10 +22,15 @@ import {
|
||||
parseJS,
|
||||
walkJS
|
||||
} from '../utils'
|
||||
import { isGloballyWhitelisted, makeMap } from '@vue/shared'
|
||||
import {
|
||||
isGloballyWhitelisted,
|
||||
makeMap,
|
||||
babelParserDefautPlugins
|
||||
} from '@vue/shared'
|
||||
import { createCompilerError, ErrorCodes } from '../errors'
|
||||
import { Node, Function, Identifier, ObjectProperty } from '@babel/types'
|
||||
import { validateBrowserExpression } from '../validateExpression'
|
||||
import { ParserPlugin } from '@babel/parser'
|
||||
|
||||
const isLiteralWhitelisted = /*#__PURE__*/ makeMap('true,false,null,this')
|
||||
|
||||
@@ -127,12 +132,7 @@ export function processExpression(
|
||||
ast = parseJS(source, {
|
||||
plugins: [
|
||||
...context.expressionPlugins,
|
||||
// by default we enable proposals slated for ES2020.
|
||||
// full list at https://babeljs.io/docs/en/next/babel-parser#plugins
|
||||
// this will need to be updated as the spec moves forward.
|
||||
'bigInt',
|
||||
'optionalChaining',
|
||||
'nullishCoalescingOperator'
|
||||
...(babelParserDefautPlugins as ParserPlugin[])
|
||||
]
|
||||
}).program
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user