I would like to be able to take a Vue.js component and compile it to static html (ideally at runtime). I do not need any javascript but I do need styles. I'm looking for a library where I could run something along the lines of this:
SomeNestedComponent.vue
<template>
<div class="world">
World!
</div>
</template>
<style lang="scss">
.world {
background: blue;
}
const vueComponent = `
<template>
<div class="hello">Hello!</div>
<SomeNextedComponent />
</template>
<style lang="scss">
.hello {
background: red;
}
</style>
`
const staticHtml = compileVueComponent(vueComponent)
Output:
<body>
<div style="background: red;">Hello!</div>
<div style="background: blue;">World!</div>
</body>
const staticHtml = compileVueComponent(vueComponent)doesn't do what you want?.htmlfile generated from a Node.js running server on each change or save I guess. What's the purpose of this?