Skip to content
This repository was archived by the owner on Aug 16, 2022. It is now read-only.

typescript support #30

Closed
davidm-public opened this issue Dec 8, 2017 · 1 comment
Closed

typescript support #30

davidm-public opened this issue Dec 8, 2017 · 1 comment

Comments

@davidm-public
Copy link

Hi, curious whether this project will support lang="ts" ?

Thanks

@eddyerburgh
Copy link
Member

eddyerburgh commented Dec 12, 2017

It's left up to the user to preprocess script/ style blocks.

The API is something like this:

const descriptor = parse(source)

// 2. pre-processors
// preProcessStyles, preProcessScript, and preProcessTemplate must be implemented by the user
// You would compile typescript in the preProcessScript function
const processedStyles = preProcessStyles(descriptor.styles)
const processedScript = preProcessScript(descriptor.script)
const processedTemplate = preProcessTemplate(descriptor.template)

// 3. vue-specific post processing
// equivalent: vue-loader/lib/style-compiler
const finalStyles = compileStyles(processedStyles)
// equivalent: vue-loader/lib/template-compiler
const renderFns = compileTemplate(processedTemplate)

// 4. assemble final component
// equivalent: parts of vue-loader/lib/loader.js and vue-loader/component-normalizer.js
const finalComponentCode = assemble(processedScript, renderFns, finalStyles)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants