createCompilerCreator() — vue Function Reference
Architecture documentation for the createCompilerCreator() function in create-compiler.ts from the vue codebase.
Entity Profile
Dependency Diagram
graph TD c7a1febd_7d58_451c_87de_b5e62d13ec87["createCompilerCreator()"] 9fa4763f_e2cf_bb11_a018_df048a4dc205["create-compiler.ts"] c7a1febd_7d58_451c_87de_b5e62d13ec87 -->|defined in| 9fa4763f_e2cf_bb11_a018_df048a4dc205 ce8f29ab_2e8d_1891_6184_d7dbc32fae79["createCompiler()"] ce8f29ab_2e8d_1891_6184_d7dbc32fae79 -->|calls| c7a1febd_7d58_451c_87de_b5e62d13ec87 6fa7ff94_417c_2300_a2f6_c0074055f6ed["detectErrors()"] c7a1febd_7d58_451c_87de_b5e62d13ec87 -->|calls| 6fa7ff94_417c_2300_a2f6_c0074055f6ed 8c37c3f7_6d20_45b0_566b_5aa0cdfb7284["createCompileToFunctionFn()"] c7a1febd_7d58_451c_87de_b5e62d13ec87 -->|calls| 8c37c3f7_6d20_45b0_566b_5aa0cdfb7284 style c7a1febd_7d58_451c_87de_b5e62d13ec87 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/compiler/create-compiler.ts lines 6–83
export function createCompilerCreator(baseCompile: Function): Function {
return function createCompiler(baseOptions: CompilerOptions) {
function compile(
template: string,
options?: CompilerOptions
): CompiledResult {
const finalOptions = Object.create(baseOptions)
const errors: WarningMessage[] = []
const tips: WarningMessage[] = []
let warn = (
msg: WarningMessage,
range: { start: number; end: number },
tip: string
) => {
;(tip ? tips : errors).push(msg)
}
if (options) {
if (__DEV__ && options.outputSourceRange) {
// $flow-disable-line
const leadingSpaceLength = template.match(/^\s*/)![0].length
warn = (
msg: WarningMessage | string,
range: { start: number; end: number },
tip: string
) => {
const data: WarningMessage = typeof msg === 'string' ? { msg } : msg
if (range) {
if (range.start != null) {
data.start = range.start + leadingSpaceLength
}
if (range.end != null) {
data.end = range.end + leadingSpaceLength
}
}
;(tip ? tips : errors).push(data)
}
}
// merge custom modules
if (options.modules) {
finalOptions.modules = (baseOptions.modules || []).concat(
options.modules
)
}
// merge custom directives
if (options.directives) {
finalOptions.directives = extend(
Object.create(baseOptions.directives || null),
options.directives
)
}
// copy other options
for (const key in options) {
if (key !== 'modules' && key !== 'directives') {
finalOptions[key] = options[key as keyof CompilerOptions]
}
}
}
finalOptions.warn = warn
const compiled = baseCompile(template.trim(), finalOptions)
if (__DEV__) {
detectErrors(compiled.ast, warn)
}
compiled.errors = errors
compiled.tips = tips
return compiled
}
return {
compile,
compileToFunctions: createCompileToFunctionFn(compile)
}
}
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does createCompilerCreator() do?
createCompilerCreator() is a function in the vue codebase, defined in src/compiler/create-compiler.ts.
Where is createCompilerCreator() defined?
createCompilerCreator() is defined in src/compiler/create-compiler.ts at line 6.
What does createCompilerCreator() call?
createCompilerCreator() calls 2 function(s): createCompileToFunctionFn, detectErrors.
What calls createCompilerCreator()?
createCompilerCreator() is called by 1 function(s): createCompiler.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free