From 811f737c43736426b33a3301e39488c233898cd7 Mon Sep 17 00:00:00 2001 From: Matteo Manzinello Date: Mon, 1 Jun 2020 12:18:59 +0200 Subject: [PATCH] mailgo style tag --- gulpfile.js | 4 +++- src/mailgo.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 675c89d..5a73580 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,5 +1,7 @@ const { src, dest, series } = require("gulp"); +const MAILGO_STYLE_TAG = "{{MAILGO_STYLE}}"; + const tsGulp = require("gulp-typescript"); const tsProject = tsGulp.createProject("tsconfig.json"); @@ -33,7 +35,7 @@ function js() { let cssMinContent = fs.readFileSync("dist/mailgo.min.css", "utf8"); return ( src("src/*.ts") - .pipe(replace("MAILGO_STYLE", cssMinContent)) + .pipe(replace(MAILGO_STYLE_TAG, cssMinContent)) .pipe(tsProject()) // .pipe(babel()) .pipe(dest("./")) diff --git a/src/mailgo.ts b/src/mailgo.ts index ba88e34..b945ba4 100644 --- a/src/mailgo.ts +++ b/src/mailgo.ts @@ -827,7 +827,7 @@ const mailgoStyle = (): void => { let mailgoCSS: HTMLStyleElement = createElement("style") as HTMLStyleElement; mailgoCSS.id = "mailgo-style"; mailgoCSS.type = "text/css"; - mailgoCSS.appendChild(createTextNode(`MAILGO_STYLE`)); + mailgoCSS.appendChild(createTextNode(`{{MAILGO_STYLE}}`)); document.head.appendChild(mailgoCSS); };