MCPcopy
hub / github.com/vuejs/core / compile

Function compile

packages/compiler-dom/src/index.ts:41–64  ·  view source on GitHub ↗
(
  src: string | RootNode,
  options: CompilerOptions = {},
)

Source from the content-addressed store, hash-verified

39}
40
41export function compile(
42 src: string | RootNode,
43 options: CompilerOptions = {},
44): CodegenResult {
45 return baseCompile(
46 src,
47 extend({}, parserOptions, options, {
48 nodeTransforms: [
49 // ignore <script> and <tag>
50 // this is not put inside DOMNodeTransforms because that list is used
51 // by compiler-ssr to generate vnode fallback branches
52 ignoreSideEffectTags,
53 ...DOMNodeTransforms,
54 ...(options.nodeTransforms || []),
55 ],
56 directiveTransforms: extend(
57 {},
58 DOMDirectiveTransforms,
59 options.directiveTransforms || {},
60 ),
61 transformHoist: __BROWSER__ ? null : stringifyStatic,
62 }),
63 )
64}
65
66export function parse(template: string, options: ParserOptions = {}): RootNode {
67 return baseParse(template, extend({}, parserOptions, options))

Callers 9

compileToFunctionFunction · 0.90
index.spec.tsFile · 0.90
checkWarningFunction · 0.90
Transition.spec.tsFile · 0.90
compileWithStringifyFunction · 0.90
compileToFunctionFunction · 0.90

Calls 1

baseCompileFunction · 0.90

Tested by 2

checkWarningFunction · 0.72
compileWithStringifyFunction · 0.72