@travetto/email-compiler 8.0.0-alpha.28 → 8.0.0-alpha.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +10 -11
  2. package/src/util.ts +8 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/email-compiler",
3
- "version": "8.0.0-alpha.28",
3
+ "version": "8.0.0-alpha.29",
4
4
  "type": "module",
5
5
  "description": "Email compiling module",
6
6
  "keywords": [
@@ -27,20 +27,19 @@
27
27
  "directory": "module/email-compiler"
28
28
  },
29
29
  "dependencies": {
30
- "@travetto/config": "^8.0.0-alpha.25",
31
- "@travetto/di": "^8.0.0-alpha.22",
32
- "@travetto/email": "^8.0.0-alpha.26",
33
- "@travetto/image": "^8.0.0-alpha.22",
34
- "@travetto/runtime": "^8.0.0-alpha.22",
35
- "@travetto/worker": "^8.0.0-alpha.23",
36
- "@types/inline-css": "^3.0.4",
30
+ "@css-inline/css-inline": "^0.21.1",
31
+ "@travetto/config": "^8.0.0-alpha.26",
32
+ "@travetto/di": "^8.0.0-alpha.23",
33
+ "@travetto/email": "^8.0.0-alpha.27",
34
+ "@travetto/image": "^8.0.0-alpha.23",
35
+ "@travetto/runtime": "^8.0.0-alpha.23",
36
+ "@travetto/worker": "^8.0.0-alpha.24",
37
37
  "html-entities": "^2.6.0",
38
- "inline-css": "^4.0.3",
39
38
  "purgecss": "^8.0.0",
40
- "sass": "^1.102.0"
39
+ "sass": "^1.103.1"
41
40
  },
42
41
  "peerDependencies": {
43
- "@travetto/cli": "^8.0.0-alpha.31"
42
+ "@travetto/cli": "^8.0.0-alpha.32"
44
43
  },
45
44
  "peerDependenciesMeta": {
46
45
  "@travetto/cli": {
package/src/util.ts CHANGED
@@ -116,18 +116,14 @@ export class EmailCompileUtil {
116
116
  */
117
117
  static async inlineCss(html: string, css: string): Promise<string> {
118
118
  // Inline css
119
- const { default: inlineCss } = await import('inline-css');
120
- return inlineCss(
121
- // Style needs to be in head to preserve media queries
122
- html.replace('</head>', `<style>${css}</style></head>`),
123
- {
124
- url: 'https://app.dev',
125
- preserveMediaQueries: true,
126
- removeStyleTags: true,
127
- removeLinkTags: true,
128
- applyStyleTags: true
129
- }
130
- );
119
+ const { inline } = await import('@css-inline/css-inline');
120
+ return inline(html, {
121
+ extraCss: css,
122
+ keepAtRules: true,
123
+ keepStyleTags: false,
124
+ keepLinkTags: false,
125
+ loadRemoteStylesheets: false
126
+ });
131
127
  }
132
128
 
133
129
  /**