Is there a way to convert a Vue.js component into static html without the need for javascript? I am specifically interested in retaining styles. I am searching for a library where I can execute code similar to 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>