|
1 | 1 | import { extendFilter, extendFunction, extendTest, extendTag } from 'twig' |
| 2 | +import { defaults } from 'email-comb' |
| 3 | +import { Options as HtmlMinifierOptions } from 'html-minifier' |
2 | 4 |
|
3 | 5 | export type FmMapFiles = { |
4 | 6 | // the `tpl` file path |
@@ -75,8 +77,6 @@ export interface AmpCreatorOptions { |
75 | 77 |
|
76 | 78 | pages?: { |
77 | 79 | [page: string]: { |
78 | | - // starts a new proxy on this port |
79 | | - //port?: number |
80 | 80 | paths: AmpCreatorOptionsPaths |
81 | 81 | } |
82 | 82 | } |
@@ -175,39 +175,28 @@ export interface AmpCreatorOptions { |
175 | 175 | media?: string[] |
176 | 176 | } |
177 | 177 |
|
178 | | - // auto use default configs with `true`; |
179 | | - // or specify custom options, see all: |
180 | | - // https://github.com/ampproject/amp-toolbox/tree/main/packages/optimizer#options |
181 | | - ampOptimize?: boolean | { |
182 | | - autoAddMandatoryTags?: boolean |
183 | | - autoExtensionImport?: boolean |
184 | | - extensionVersions?: Object |
185 | | - format?: string | 'AMP' | 'AMP4EMAIL' | 'AMP4ADS' |
186 | | - imageBasePath?: string | ( |
187 | | - /** |
188 | | - * @param imgSrc the path used in `src` |
189 | | - * @param params todo: correctly type this |
190 | | - */ |
191 | | - (imgSrc: string, params: any) => string) |
192 | | - imageOptimizer?: (src: string, width: string | number) => string |
193 | | - lts?: boolean |
194 | | - markdown?: boolean |
195 | | - minify?: boolean |
196 | | - preloadHeroImage?: boolean |
197 | | - verbose?: boolean |
198 | | - } |
| 178 | + // enable the ampOptimizer, since 1.0.0-alpha.12 pass down an instance! |
| 179 | + ampOptimizer?: any |
199 | 180 |
|
200 | 181 | // custom inject tag, for AMP / default: 'style amp-custom>' |
201 | 182 | cssInjectTag?: string |
| 183 | + // if an `Error` should be thrown when exceeding `cssSizeLimit` |
202 | 184 | cssFailOnSize?: boolean |
| 185 | + // maximum bytes for CSS file, after minimizing, before clean-unused, |
| 186 | + // defaults to `75000` bytes (AMP limit) |
| 187 | + cssSizeLimit?: number |
203 | 188 |
|
204 | 189 | // remove unused inline CSS |
205 | 190 | cleanInlineCSS?: boolean |
206 | 191 | // css selectors which must not be removed, `.classes`, `#ids`, `.simple-whitelist-*`, `h1`, `p` |
207 | 192 | cleanInlineCSSWhitelist?: string[] |
| 193 | + // options for `email-comb` - run when `cleanInlineCSS` is `true`, |
| 194 | + // when `cleanInlineCSSOptions` specified the `cleanInlineCSSWhitelist` options does nothing |
| 195 | + cleanInlineCSSOptions?: Partial<typeof defaults> |
208 | 196 |
|
209 | | - // minify HTML, when not using `ampOptimize` |
| 197 | + // minify HTML, when not using `ampOptimizer` |
210 | 198 | minifyHtml?: boolean |
| 199 | + minifyHtmlOptions?: HtmlMinifierOptions |
211 | 200 |
|
212 | 201 | // additional folders to delete |
213 | 202 | cleanFolders?: string[] |
|
0 commit comments