vue-compiler
For those who can't use webpack in their project.
Basic Usage
const code map = await // :tada:
Table of Contents
- vue-compiler
- Basic Usage
- Table of Contents
- API
- compile(source: string, options: CompileOptions): Promise<CompileResult>
- compileSync(source: string, options: CompileOptions): CompileResult
- parse(source: string, options: ParseOptions): SFCDescriptor
- compileTemplate(block: SFCBlock, options: CompileTemplateOptions): SFCTemplateBlock
- compileStyle(block: SFCBlock, options: CompileStyleOptions): Promise<SFCStyleBlock>
- assemble(components: AssembleInput, options: AssembleOptions): AssembleResult
- normalize(runtime: NormalizerRuntime): (component: ComponentDescriptor) => any
API
compile(source: string, options: CompileOptions): Promise<CompileResult>
Compile SFC source code to a single cmd module.
parse(source: string, options: ParseOptions): SFCDescriptor
Parse SFC source into a descriptor.
compileTemplate(block: SFCBlock, options: CompileTemplateOptions): SFCTemplateBlock
Takes a block comes from parse
method and transform it into a template block.
The sourceNode
of the origin block will be compiled with vue-template-compiler
, and additional info will be added to the block.
compileStyle(block: SFCBlock, options: CompileStyleOptions): Promise<SFCStyleBlock>
Takes a block comes from parse
method and transform it into a style block.
The sourceNode
of the origin block will be compiled with scoped-id
and postcss-modules
plugin, and additional info will be added to the block.
assemble(components: AssembleInput, options: AssembleOptions): AssembleResult
Assemble blocks into a code block that evaluates to a ComponentDescriptor
.
normalize(runtime: NormalizerRuntime): (component: ComponentDescriptor) => any