vue-email / cli Goto Github PK
View Code? Open in Web Editor NEW⚡️ Vue Email Generation CLI Experience
Home Page: https://vuemail.net/plugins/cli
License: MIT License
⚡️ Vue Email Generation CLI Experience
Home Page: https://vuemail.net/plugins/cli
License: MIT License
import Header from '@/components/Header.vue'
And use <Header />
npx vue-email export --dir=src/pages --pretty=true
ℹ ✨ Generating HTML versions of emails 03:40:12
Error loading component node:internal/modules/cjs/loader:1080
throw err;
^
Error: Cannot find module '@/components/Header.vue'
Require stack:
- G:\projects\vue-mail\node_modules\import-string\dist\x5D0IVk9TuHo-qVRIm8yo.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
at Module._load (node:internal/modules/cjs/loader:922:27)
at Module.require (node:internal/modules/cjs/loader:1143:19)
at require (node:internal/modules/cjs/helpers:119:18)
at G:\projects\vue-mail\node_modules\import-string\dist\x5D0IVk9TuHo-qVRIm8yo.js:43:29
at Script.runInContext (node:vm:135:12)
at Script.runInNewContext (node:vm:140:17)
at Object.runInNewContext (node:vm:292:38)
at requireFromString (G:\projects\vue-mail\node_modules\module-from-string\dist\index.js:134:6)
at importFromStringSync (G:\projects\vue-mail\node_modules\module-from-string\dist\index.js:248:12) {
code: 'MODULE_NOT_FOUND',
Okay, so I've tried that with the exact structure
emails/
Email/
BrandedHeader.vue
MyMail.vue
BrandedHeader.vue
<script setup>
import { ESection, EText } from "vue-email";
</script>
<template>
<e-heading as="h1">
Some Brand Name
</e-heading>
</template>
MyMail.vue
<script setup>
import { EButton, EHtml } from 'vue-email'
</script>
<template>
<EHtml lang="en">
<BrandedHeader/>
<EButton href="https://example.com" style="color: #61dafb">
Click me
</EButton>
</EHtml>
</template>
now I run the command in the root
npx vue-email export
And get the output
$ npx vue-email export
ℹ ✨ Generating HTML versions of emails 13:01:06
[Vue warn]: Failed to resolve component: BrandedHeader
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
ℹ 🪄 Generated MyMail 13:01:06
ℹ 🪄 Generated Email/BrandedHeader
And this is the generated HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html id="__vue-email" lang="en" dir="ltr">
<BrandedHeader></BrandedHeader>
<a data-id="__vue-email-button"
style="line-height:100%;text-decoration:none;display:inline-block;max-width:100%;color:#61dafb;"
href="https://example.com" target="_blank"><span><!--[if mso]><i style="letter-spacing: 0px;mso-font-width:-100%;mso-text-raise:0" hidden> </i><![endif]--></span><span
style="max-width:100%;display:inline-block;line-height:120%;text-decoration:none;text-transform:none;mso-padding-alt:0px;mso-text-raise:0;"> Click me </span><span><!--[if mso]><i style="letter-spacing: 0px;mso-font-width:-100%" hidden> </i><![endif]--></span></a>
</html>
I've tried that also with imports, but this leads to an error.
Am I missing something like an extra config file or something like that?
Originally posted by @mklueh in vue-email/vue-email#82 (comment)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.