Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

155
Views
Compile Vue.js to static HTML

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>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You will not get any benefits from using Vue here especially for email templates, quite the opposite (need back and forth without a lot of plus value).

If you need to create some dynamic views with backend data, you'll better be using EJS, Jinja, pug or any other backend templating language. You could achieve dynamic rendering, looping on lists, bring your CSS and pretty much everything needed for an email template.


This video could also be somehow helpful I guess (didn't watched it myself): https://www.vuemastery.com/conferences/vueconf-us-2021/html-email-with-vue.js/

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!