@maizzle/framework 4.8.7 → 5.0.0-beta.0
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.
- package/bin/maizzle +3 -1
- package/package.json +65 -58
- package/src/commands/build.js +244 -19
- package/src/commands/serve.js +2 -197
- package/src/generators/plaintext.js +192 -91
- package/src/generators/render.js +128 -0
- package/src/index.js +46 -14
- package/src/{generators/posthtml → posthtml}/defaultComponentsConfig.js +6 -4
- package/src/{generators/posthtml → posthtml}/defaultConfig.js +1 -1
- package/src/posthtml/index.js +74 -0
- package/src/posthtml/plugins/expandLinkTag.js +36 -0
- package/src/server/client.js +181 -0
- package/src/server/index.js +383 -0
- package/src/server/routes/hmr.js +24 -0
- package/src/server/routes/index.js +38 -0
- package/src/server/views/error.html +83 -0
- package/src/server/views/index.html +24 -0
- package/src/server/websockets.js +27 -0
- package/src/transformers/addAttributes.js +30 -0
- package/src/transformers/attributeToStyle.js +30 -36
- package/src/transformers/baseUrl.js +52 -23
- package/src/transformers/comb.js +51 -0
- package/src/transformers/core.js +20 -0
- package/src/transformers/filters/defaultFilters.js +90 -70
- package/src/transformers/filters/index.js +14 -78
- package/src/transformers/index.js +268 -63
- package/src/transformers/inline.js +240 -0
- package/src/transformers/markdown.js +13 -14
- package/src/transformers/minify.js +21 -16
- package/src/transformers/posthtmlMso.js +13 -8
- package/src/transformers/prettify.js +16 -15
- package/src/transformers/preventWidows.js +32 -26
- package/src/transformers/removeAttributes.js +17 -17
- package/src/transformers/replaceStrings.js +30 -9
- package/src/transformers/safeClassNames.js +24 -24
- package/src/transformers/shorthandCss.js +22 -0
- package/src/transformers/sixHex.js +15 -15
- package/src/transformers/urlParameters.js +18 -16
- package/src/transformers/useAttributeSizes.js +65 -0
- package/src/utils/getConfigByFilePath.js +124 -0
- package/src/utils/node.js +68 -0
- package/src/utils/string.js +117 -0
- package/types/build.d.ts +117 -57
- package/types/components.d.ts +130 -112
- package/types/config.d.ts +454 -242
- package/types/css/inline.d.ts +234 -0
- package/types/css/purge.d.ts +125 -0
- package/types/events.d.ts +5 -105
- package/types/index.d.ts +148 -116
- package/types/markdown.d.ts +20 -18
- package/types/minify.d.ts +122 -120
- package/types/plaintext.d.ts +46 -52
- package/types/posthtml.d.ts +103 -136
- package/types/render.d.ts +0 -117
- package/types/urlParameters.d.ts +21 -20
- package/types/widowWords.d.ts +9 -7
- package/src/functions/plaintext.js +0 -5
- package/src/functions/render.js +0 -5
- package/src/generators/config.js +0 -52
- package/src/generators/output/index.js +0 -4
- package/src/generators/output/to-disk.js +0 -254
- package/src/generators/output/to-string.js +0 -73
- package/src/generators/postcss.js +0 -23
- package/src/generators/posthtml/index.js +0 -75
- package/src/generators/tailwindcss.js +0 -157
- package/src/transformers/extraAttributes.js +0 -33
- package/src/transformers/inlineCss.js +0 -42
- package/src/transformers/removeInlineBackgroundColor.js +0 -56
- package/src/transformers/removeInlineSizes.js +0 -43
- package/src/transformers/removeInlinedSelectors.js +0 -100
- package/src/transformers/removeUnusedCss.js +0 -48
- package/src/transformers/shorthandInlineCSS.js +0 -26
- package/src/utils/helpers.js +0 -13
- package/types/baseUrl.d.ts +0 -79
- package/types/fetch.d.ts +0 -143
- package/types/inlineCss.d.ts +0 -207
- package/types/layouts.d.ts +0 -39
- package/types/removeUnusedCss.d.ts +0 -115
- package/types/tailwind.d.ts +0 -22
- package/types/templates.d.ts +0 -181
package/types/index.d.ts
CHANGED
|
@@ -1,90 +1,110 @@
|
|
|
1
|
-
import type {AttributeToStyleSupportedAttributes} from './inlineCss';
|
|
2
|
-
import type BaseURLConfig from './baseURL';
|
|
3
1
|
import type Config from './config';
|
|
4
|
-
import type {CoreBeautifyOptions} from 'js-beautify';
|
|
5
|
-
import type InlineCSSConfig from './inlineCss';
|
|
6
|
-
import type {Options as MarkdownItOptions} from 'markdown-it';
|
|
7
2
|
import type MinifyConfig from './minify';
|
|
3
|
+
import type PostHTMLConfig from './posthtml';
|
|
4
|
+
import type { RenderOutput } from './render';
|
|
5
|
+
import type MarkdownConfig from './markdown';
|
|
6
|
+
import type PurgeCSSConfig from './css/purge';
|
|
8
7
|
import type PlaintextConfig from './plaintext';
|
|
9
|
-
import type
|
|
10
|
-
import type {RenderOutput} from './render';
|
|
11
|
-
import type RemoveUnusedCSSConfig from './removeUnusedCss';
|
|
12
|
-
import type URLParametersConfig from './urlParameters';
|
|
8
|
+
import type CSSInlineConfig from './css/inline';
|
|
13
9
|
import type WidowWordsConfig from './widowWords';
|
|
10
|
+
import type { BaseURLConfig } from 'posthtml-base-url';
|
|
11
|
+
import type { HTMLBeautifyOptions } from 'js-beautify'
|
|
12
|
+
import type { URLParametersConfig } from 'posthtml-url-parameters';
|
|
13
|
+
import type { AttributeToStyleSupportedAttributes } from './css/inline';
|
|
14
14
|
|
|
15
15
|
declare namespace MaizzleFramework {
|
|
16
16
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
* Compile an HTML string with Maizzle.
|
|
18
|
+
*
|
|
19
|
+
* @param {string} html The HTML string to render.
|
|
20
|
+
* @param {Config} [config] A Maizzle configuration object.
|
|
21
|
+
* @returns {Promise<RenderOutput>} The rendered HTML and the Maizzle configuration object.
|
|
22
|
+
*/
|
|
23
|
+
function render(html: string, config?: Config): Promise<RenderOutput>;
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
* Normalize escaped character class names like `\:` or `\/` by replacing them with email-safe alternatives.
|
|
27
|
+
*
|
|
28
|
+
* @param {string} html The HTML string to normalize.
|
|
29
|
+
* @param {Record<string, string>} replacements A dictionary of replacements to apply.
|
|
30
|
+
* @returns {string} The normalized HTML string.
|
|
31
|
+
* @see https://maizzle.com/docs/transformers/safe-class-names
|
|
29
32
|
*/
|
|
30
33
|
function safeClassNames(html: string, replacements: Record<string, string>): string;
|
|
31
34
|
|
|
32
35
|
/**
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
* Compile Markdown to HTML.
|
|
37
|
+
*
|
|
38
|
+
* @param {string} input The Markdown string to compile.
|
|
39
|
+
* @param {MarkdownConfig} [options] A configuration object for the Markdown compiler.
|
|
40
|
+
* @returns {string} The compiled HTML string.
|
|
41
|
+
* @see https://maizzle.com/docs/transformers/markdown
|
|
37
42
|
*/
|
|
38
|
-
function markdown(input: string, options?:
|
|
43
|
+
function markdown(input: string, options?: MarkdownConfig): string;
|
|
39
44
|
|
|
40
45
|
/**
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
* Prevent widow words inside a tag by adding a ` ` between its last two words.
|
|
47
|
+
*
|
|
48
|
+
* @param {string} html The HTML string to process.
|
|
49
|
+
* @param {WidowWordsConfig} [options] A configuration object for the widow words transformer.
|
|
50
|
+
* @returns {string} The processed HTML string.
|
|
51
|
+
* @see https://maizzle.com/docs/transformers/widows
|
|
52
|
+
*/
|
|
46
53
|
function preventWidows(html: string, options?: WidowWordsConfig): string;
|
|
47
54
|
|
|
48
55
|
/**
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
* Duplicate HTML attributes to inline CSS.
|
|
57
|
+
*
|
|
58
|
+
* @param {string} html The HTML string to process.
|
|
59
|
+
* @param {AttributeToStyleSupportedAttributes[]} attributes An array of attributes to inline.
|
|
60
|
+
* @param {PostHTMLConfig} [posthtmlConfig] A configuration object for PostHTML.
|
|
61
|
+
* @returns {string} The processed HTML string.
|
|
62
|
+
* @see https://maizzle.com/docs/transformers/attribute-to-style
|
|
63
|
+
*/
|
|
54
64
|
function attributeToStyle(
|
|
55
65
|
html: string,
|
|
56
|
-
|
|
66
|
+
attributes: AttributeToStyleSupportedAttributes[],
|
|
67
|
+
posthtmlConfig?: PostHTMLConfig
|
|
57
68
|
): string;
|
|
58
69
|
|
|
59
70
|
/**
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
71
|
+
* Inline CSS styles in an HTML string.
|
|
72
|
+
*
|
|
73
|
+
* @param {string} html The HTML string to process.
|
|
74
|
+
* @param {CSSInlineConfig} [options] A configuration object for the CSS inliner.
|
|
75
|
+
* @returns {string} The processed HTML string.
|
|
76
|
+
* @see https://maizzle.com/docs/transformers/inline-css
|
|
77
|
+
*/
|
|
78
|
+
function inlineCSS(html: string, options?: CSSInlineConfig): string;
|
|
66
79
|
|
|
67
80
|
/**
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
81
|
+
* Rewrite longhand CSS inside style attributes with shorthand syntax.
|
|
82
|
+
* Only works with margin, padding and border, and only when all sides are specified.
|
|
83
|
+
*
|
|
84
|
+
* @param {string} html The HTML string to process.
|
|
85
|
+
* @returns {string} The processed HTML string.
|
|
86
|
+
* @see https://maizzle.com/docs/transformers/shorthand-css
|
|
87
|
+
*/
|
|
73
88
|
function shorthandCSS(html: string): string;
|
|
74
89
|
|
|
75
90
|
/**
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
91
|
+
* Remove unused CSS from `<style>` tags and HTML elements.
|
|
92
|
+
*
|
|
93
|
+
* @param {string} html The HTML string to process.
|
|
94
|
+
* @param {PurgeCSSConfig} [options] A configuration object for `email-comb`.
|
|
95
|
+
* @returns {string} The processed HTML string.
|
|
96
|
+
* @see https://maizzle.com/docs/transformers/remove-unused-css
|
|
97
|
+
*/
|
|
98
|
+
function removeUnusedCSS(html: string, options?: PurgeCSSConfig): string;
|
|
82
99
|
|
|
83
100
|
/**
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
101
|
+
* Remove HTML attributes from an HTML string.
|
|
102
|
+
*
|
|
103
|
+
* @param {string} html The HTML string to process.
|
|
104
|
+
* @param {string[] | Array<{ name: string; value: string | RegExp }>} [options] An array of attribute names to remove, or an array of objects with `name` and `value` properties.
|
|
105
|
+
* @returns {string} The processed HTML string.
|
|
106
|
+
* @see https://maizzle.com/docs/transformers/remove-attributes
|
|
107
|
+
*/
|
|
88
108
|
function removeAttributes(
|
|
89
109
|
html: string,
|
|
90
110
|
options?:
|
|
@@ -96,92 +116,104 @@ declare namespace MaizzleFramework {
|
|
|
96
116
|
): string;
|
|
97
117
|
|
|
98
118
|
/**
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
119
|
+
* Add attributes to elements in an HTML string.
|
|
120
|
+
*
|
|
121
|
+
* @param {string} html The HTML string to process.
|
|
122
|
+
* @param {Record<string, unknown>} [options] A dictionary of attributes to add.
|
|
123
|
+
* @returns {string} The processed HTML string.
|
|
124
|
+
* @see https://maizzle.com/docs/transformers/add-attributes
|
|
125
|
+
*/
|
|
104
126
|
function addAttributes(html: string, options?: Record<string, unknown>): string;
|
|
105
127
|
|
|
106
128
|
/**
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
129
|
+
* Pretty-print an HTML string.
|
|
130
|
+
*
|
|
131
|
+
* @param {string} html The HTML string to prettify.
|
|
132
|
+
* @param {HTMLBeautifyOptions} [options] A configuration object for `js-beautify`.
|
|
133
|
+
* @returns {string} The prettified HTML string.
|
|
134
|
+
* @see https://maizzle.com/docs/transformers/prettify
|
|
135
|
+
*/
|
|
136
|
+
function prettify(html: string, options?: HTMLBeautifyOptions): string;
|
|
112
137
|
|
|
113
138
|
/**
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
139
|
+
* Prepend a string to sources and hrefs in an HTML string.
|
|
140
|
+
*
|
|
141
|
+
* @param {string} html The HTML string to process.
|
|
142
|
+
* @param {string | BaseURLConfig} [options] A string to prepend to sources and hrefs, or a configuration object for `posthtml-base-url`.
|
|
143
|
+
* @returns {string} The processed HTML string.
|
|
144
|
+
* @see https://maizzle.com/docs/transformers/base-url
|
|
145
|
+
*/
|
|
119
146
|
function applyBaseURL(html: string, options?: string | BaseURLConfig): string;
|
|
120
147
|
|
|
121
148
|
/**
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
149
|
+
* Append parameters to URLs in an HTML string.
|
|
150
|
+
*
|
|
151
|
+
* @param {string} html The HTML string to process.
|
|
152
|
+
* @param {URLParametersConfig} [options] A configuration object for `posthtml-url-parameters`.
|
|
153
|
+
* @returns {string} The processed HTML string.
|
|
154
|
+
* @see https://maizzle.com/docs/transformers/url-parameters
|
|
155
|
+
*/
|
|
126
156
|
function addURLParameters(html: string, options?: URLParametersConfig): string;
|
|
127
157
|
|
|
128
158
|
/**
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
159
|
+
* Ensure that all HEX colors inside `bgcolor` and `color` attributes are defined with six digits.
|
|
160
|
+
*
|
|
161
|
+
* @param {string} html The HTML string to process.
|
|
162
|
+
* @returns {string} The processed HTML string.
|
|
163
|
+
* @see https://maizzle.com/docs/transformers/six-hex
|
|
164
|
+
*/
|
|
165
|
+
function sixHEX(html: string): string;
|
|
134
166
|
|
|
135
167
|
/**
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
168
|
+
* Minify an HTML string, with email client considerations.
|
|
169
|
+
*
|
|
170
|
+
* @param {string} html The HTML string to minify.
|
|
171
|
+
* @param {MinifyConfig} [options] A configuration object for `html-minifier`.
|
|
172
|
+
* @returns {string} The minified HTML string.
|
|
173
|
+
* @see https://maizzle.com/docs/transformers/minify
|
|
174
|
+
*/
|
|
141
175
|
function minify(html: string, options?: MinifyConfig): string;
|
|
142
176
|
|
|
143
177
|
/**
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
178
|
+
* Batch-replace strings in an HTML string.
|
|
179
|
+
*
|
|
180
|
+
* @param {string} html The HTML string to process.
|
|
181
|
+
* @param {Record<string, string>} [replacements] A dictionary of strings to replace.
|
|
182
|
+
* @returns {string} The processed HTML string.
|
|
183
|
+
* @see https://maizzle.com/docs/transformers/replace-strings
|
|
184
|
+
*/
|
|
149
185
|
function replaceStrings(html: string, replacements?: Record<string, string>): string;
|
|
150
186
|
|
|
151
187
|
/**
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
plaintext: string;
|
|
160
|
-
destination: string;
|
|
161
|
-
}>;
|
|
188
|
+
* Generate a plaintext version of an HTML string.
|
|
189
|
+
* @param {string} html - The HTML string to convert to plaintext.
|
|
190
|
+
* @param {PlaintextConfig} [options] - A configuration object for the plaintext generator.
|
|
191
|
+
* @returns {Promise<string>} The plaintext version of the HTML string.
|
|
192
|
+
* @see https://maizzle.com/docs/plaintext
|
|
193
|
+
*/
|
|
194
|
+
function plaintext(html: string, options?: PlaintextConfig): Promise<string>;
|
|
162
195
|
|
|
163
196
|
export {
|
|
164
197
|
Config,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
addAttributes,
|
|
168
|
-
addURLParameters,
|
|
169
|
-
applyBaseURL,
|
|
170
|
-
attributeToStyle,
|
|
171
|
-
ensureSixHex,
|
|
172
|
-
inlineCSS,
|
|
198
|
+
render,
|
|
199
|
+
safeClassNames,
|
|
173
200
|
markdown,
|
|
174
|
-
minify,
|
|
175
|
-
plaintext,
|
|
176
201
|
preventWidows,
|
|
177
|
-
|
|
178
|
-
|
|
202
|
+
attributeToStyle,
|
|
203
|
+
inlineCSS,
|
|
204
|
+
shorthandCSS,
|
|
179
205
|
removeUnusedCSS,
|
|
180
|
-
|
|
206
|
+
removeUnusedCSS as purgeCSS,
|
|
207
|
+
removeAttributes,
|
|
208
|
+
addAttributes,
|
|
209
|
+
prettify,
|
|
210
|
+
applyBaseURL,
|
|
211
|
+
addURLParameters as addUrlParams,
|
|
212
|
+
sixHEX,
|
|
213
|
+
minify,
|
|
181
214
|
replaceStrings,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
};
|
|
215
|
+
plaintext,
|
|
216
|
+
}
|
|
185
217
|
}
|
|
186
218
|
|
|
187
219
|
export = MaizzleFramework;
|
package/types/markdown.d.ts
CHANGED
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
import type {Options as MarkdownItOptions} from 'markdown-it';
|
|
1
|
+
import type { Options as MarkdownItOptions } from 'markdown-it';
|
|
2
2
|
|
|
3
3
|
export default interface MarkdownConfig {
|
|
4
4
|
/**
|
|
5
|
-
Path relative to which markdown files are imported.
|
|
6
|
-
|
|
7
|
-
@default './'
|
|
8
|
-
|
|
5
|
+
* Path relative to which markdown files are imported.
|
|
6
|
+
*
|
|
7
|
+
* @default './'
|
|
8
|
+
*/
|
|
9
9
|
root?: string;
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
Encoding for imported Markdown files.
|
|
13
|
-
|
|
14
|
-
@default 'utf8'
|
|
15
|
-
|
|
12
|
+
* Encoding for imported Markdown files.
|
|
13
|
+
*
|
|
14
|
+
* @default 'utf8'
|
|
15
|
+
*/
|
|
16
16
|
encoding?: string;
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
Options to pass to the `markdown-it` library.
|
|
20
|
-
|
|
21
|
-
@default {}
|
|
22
|
-
|
|
19
|
+
* Options to pass to the `markdown-it` library.
|
|
20
|
+
*
|
|
21
|
+
* @default {}
|
|
22
|
+
*/
|
|
23
23
|
markdownit?: MarkdownItOptions;
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
Plugins for the `markdown-it` library.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
* Plugins for the `markdown-it` library.
|
|
27
|
+
* @default []
|
|
28
|
+
*/
|
|
29
|
+
plugins?: Array<{
|
|
30
|
+
plugin: string;
|
|
31
|
+
options: Record<string, unknown>;
|
|
32
|
+
}>;
|
|
31
33
|
}
|
package/types/minify.d.ts
CHANGED
|
@@ -1,136 +1,138 @@
|
|
|
1
|
+
import type { Opts } from 'html-crush';
|
|
2
|
+
|
|
1
3
|
export default interface MinifyConfig {
|
|
2
4
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
lineLengthLimit?:
|
|
5
|
+
* Maximum line length. Works only when `removeLineBreaks` is `true`.
|
|
6
|
+
*
|
|
7
|
+
* @default 500
|
|
8
|
+
*/
|
|
9
|
+
lineLengthLimit?: Opts['lineLengthLimit'];
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
removeLineBreaks?:
|
|
12
|
+
* Remove all line breaks from HTML when minifying.
|
|
13
|
+
*
|
|
14
|
+
* @default true
|
|
15
|
+
*/
|
|
16
|
+
removeLineBreaks?: Opts['removeLineBreaks'];
|
|
15
17
|
|
|
16
18
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
* Remove code indentation when minifying HTML.
|
|
20
|
+
*
|
|
21
|
+
* @default true
|
|
20
22
|
*/
|
|
21
|
-
removeIndentations?:
|
|
23
|
+
removeIndentations?: Opts['removeIndentations'];
|
|
22
24
|
|
|
23
25
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
removeHTMLComments?:
|
|
26
|
+
* Remove `<!-- HTML comments -->` when minifying HTML.
|
|
27
|
+
*
|
|
28
|
+
* `0` - don't remove any HTML comments
|
|
29
|
+
*
|
|
30
|
+
* `1` - remove all comments except Outlook conditional comments
|
|
31
|
+
*
|
|
32
|
+
* `2` - remove all comments, including Outlook conditional comments
|
|
33
|
+
*
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
removeHTMLComments?: Opts['removeHTMLComments'];
|
|
35
37
|
|
|
36
38
|
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
removeCSSComments?:
|
|
39
|
+
* Remove CSS comments when minifying HTML.
|
|
40
|
+
*
|
|
41
|
+
* @default true
|
|
42
|
+
*/
|
|
43
|
+
removeCSSComments?: Opts['removeCSSComments'];
|
|
42
44
|
|
|
43
45
|
/**
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
breakToTheLeftOf?:
|
|
46
|
+
* When any of given strings are encountered and `removeLineBreaks` is true, current line will be terminated.
|
|
47
|
+
*
|
|
48
|
+
* @default
|
|
49
|
+
* [
|
|
50
|
+
* '</td',
|
|
51
|
+
* '<html',
|
|
52
|
+
* '</html',
|
|
53
|
+
* '<head',
|
|
54
|
+
* '</head',
|
|
55
|
+
* '<meta',
|
|
56
|
+
* '<link',
|
|
57
|
+
* '<table',
|
|
58
|
+
* '<script',
|
|
59
|
+
* '</script',
|
|
60
|
+
* '<!DOCTYPE',
|
|
61
|
+
* '<style',
|
|
62
|
+
* '</style',
|
|
63
|
+
* '<title',
|
|
64
|
+
* '<body',
|
|
65
|
+
* '@media',
|
|
66
|
+
* '</body',
|
|
67
|
+
* '<!--[if',
|
|
68
|
+
* '<!--<![endif',
|
|
69
|
+
* '<![endif]'
|
|
70
|
+
* ]
|
|
71
|
+
*/
|
|
72
|
+
breakToTheLeftOf?: Opts['breakToTheLeftOf'];
|
|
71
73
|
|
|
72
74
|
/**
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
mindTheInlineTags?:
|
|
75
|
+
* Some inline tags can accidentally introduce extra text.
|
|
76
|
+
* The minifier will take extra precaution when minifying around these tags.
|
|
77
|
+
*
|
|
78
|
+
* @default
|
|
79
|
+
* [
|
|
80
|
+
* 'a',
|
|
81
|
+
* 'abbr',
|
|
82
|
+
* 'acronym',
|
|
83
|
+
* 'audio',
|
|
84
|
+
* 'b',
|
|
85
|
+
* 'bdi',
|
|
86
|
+
* 'bdo',
|
|
87
|
+
* 'big',
|
|
88
|
+
* 'br',
|
|
89
|
+
* 'button',
|
|
90
|
+
* 'canvas',
|
|
91
|
+
* 'cite',
|
|
92
|
+
* 'code',
|
|
93
|
+
* 'data',
|
|
94
|
+
* 'datalist',
|
|
95
|
+
* 'del',
|
|
96
|
+
* 'dfn',
|
|
97
|
+
* 'em',
|
|
98
|
+
* 'embed',
|
|
99
|
+
* 'i',
|
|
100
|
+
* 'iframe',
|
|
101
|
+
* 'img',
|
|
102
|
+
* 'input',
|
|
103
|
+
* 'ins',
|
|
104
|
+
* 'kbd',
|
|
105
|
+
* 'label',
|
|
106
|
+
* 'map',
|
|
107
|
+
* 'mark',
|
|
108
|
+
* 'meter',
|
|
109
|
+
* 'noscript',
|
|
110
|
+
* 'object',
|
|
111
|
+
* 'output',
|
|
112
|
+
* 'picture',
|
|
113
|
+
* 'progress',
|
|
114
|
+
* 'q',
|
|
115
|
+
* 'ruby',
|
|
116
|
+
* 's',
|
|
117
|
+
* 'samp',
|
|
118
|
+
* 'script',
|
|
119
|
+
* 'select',
|
|
120
|
+
* 'slot',
|
|
121
|
+
* 'small',
|
|
122
|
+
* 'span',
|
|
123
|
+
* 'strong',
|
|
124
|
+
* 'sub',
|
|
125
|
+
* 'sup',
|
|
126
|
+
* 'svg',
|
|
127
|
+
* 'template',
|
|
128
|
+
* 'textarea',
|
|
129
|
+
* 'time',
|
|
130
|
+
* 'u',
|
|
131
|
+
* 'tt',
|
|
132
|
+
* 'var',
|
|
133
|
+
* 'video',
|
|
134
|
+
* 'wbr'
|
|
135
|
+
* ]
|
|
136
|
+
*/
|
|
137
|
+
mindTheInlineTags?: Opts['mindTheInlineTags'];
|
|
136
138
|
}
|