@staticbolt/core 1.0.0-beta.3 → 1.0.0-beta.30

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deferred-DTj91vEg.mjs","names":[],"sources":["../src/helpers/format-code.ts","../src/helpers/deferred-pass.ts","../src/plugins/core-plugins/html-metadata/minify-html.ts","../src/plugins/core-plugins/html-metadata/deferred.ts","../src/plugins/core-plugins/markdown-metadata/deferred.ts","../src/plugins/core-plugins/script-metadata/minify-script.ts","../src/plugins/core-plugins/script-metadata/deferred.ts","../src/plugins/core-plugins/style-metadata/minify-style.ts","../src/plugins/core-plugins/style-metadata/deferred.ts","../src/plugins/core-plugins/svg-metadata/deferred.ts"],"sourcesContent":["import type { ValueOrError } from \"../utilities/value-or-error.ts\";\nimport type { Options } from \"prettier\";\n\ntype Lang = \"js\" | \"html\" | \"css\" | \"markdown\" | \"ts\" | \"json\";\n\nconst fallbackConfig: Options = { printWidth: 130 };\n\n/**\n * Prettier resolves a config per file, and a file gets the same one every time, so the answers are kept. A build can be spread\n * across threads, and a cache that only remembered the first answer would hand a file whatever config the thread happened to\n * start on.\n */\nconst prettierConfigs = new Map<string, Options>();\n\n/** - Format code using Prettier */\nexport async function formatCode(code: string, filePath: string, lang: Lang): Promise<ValueOrError<string>> {\n const { format } = await import(\"prettier\");\n\n try {\n const options = await loadPrettierConfig(filePath);\n\n const parser = lang === \"js\" ? \"babel\" : lang === \"ts\" ? \"typescript\" : lang;\n const formattedCode = await format(code, { ...options, parser, filepath: filePath });\n\n return [formattedCode, null];\n } catch {\n return [null, new Error(`Prettier formatting failed for '${filePath}'`)];\n }\n}\n\nasync function loadPrettierConfig(filePath: string): Promise<Options> {\n const cached = prettierConfigs.get(filePath);\n if (cached) {\n return cached;\n }\n\n const options = await resolvePrettierConfig(filePath);\n prettierConfigs.set(filePath, options);\n\n return options;\n}\n\nasync function resolvePrettierConfig(filePath: string): Promise<Options> {\n const { resolveConfig } = await import(\"prettier\");\n const organizeImports = await import(\"prettier-plugin-organize-imports\");\n\n try {\n const resolved = (await resolveConfig(filePath)) ?? fallbackConfig;\n\n const plugins = [...(resolved.plugins ?? [])];\n if (!plugins.includes(\"prettier-plugin-jsdoc\")) {\n plugins.push(organizeImports.default);\n }\n\n return { ...resolved, plugins };\n } catch {\n return fallbackConfig;\n }\n}\n","import type { DeferredPass } from \"@staticbolt/core\";\n\nlet resolved: string | undefined;\n\n/**\n * Names one of the passes the core plugins export, for a caller that would rather run it somewhere else.\n *\n * The module is resolved through the package's own exports rather than built from a relative path, so the URL still means the\n * same thing to a worker thread, which has no idea where the plugin that handed it a pass was running from.\n */\nexport function coreDeferredPass(exportName: string, payload?: unknown): DeferredPass {\n resolved ??= import.meta.resolve(\"@staticbolt/core/deferred\");\n\n return { module: resolved, export: exportName, payload };\n}\n","import type { ValueOrError } from \"../../../utilities/value-or-error.ts\";\n\nexport async function minifyHtmlTerser(code: string): Promise<ValueOrError<string>> {\n try {\n const { default: htmlTerser } = await import(\"html-minifier-terser\");\n\n const minified = await htmlTerser.minify(code, {\n minifyCSS: false,\n minifyJS: false,\n removeComments: true,\n collapseWhitespace: true,\n });\n\n return [minified, null];\n } catch {\n return [null, new Error(\"Failed to minify HTML\")];\n }\n}\n","import { coreDeferredPass } from \"../../../helpers/deferred-pass.ts\";\nimport { formatCode } from \"../../../helpers/format-code.ts\";\nimport { minifyHtmlTerser } from \"./minify-html.ts\";\n\nimport type { DeferredPass, DeferredPassHandler } from \"@staticbolt/core\";\n\nexport interface FormatHtmlPayload {\n /** Where the document lives in the project, for Prettier to resolve its config against. */\n filePath: string;\n}\n\n/** The pass `coreHtmlPlugin` runs over a printed document when formatting. */\nexport const formatHtml: DeferredPassHandler<FormatHtmlPayload> = async (code, { filePath }) => {\n const [formatted, formatError] = await formatCode(code, filePath, \"html\");\n if (formatError) throw formatError;\n\n return formatted;\n};\n\n/** The pass `coreHtmlPlugin` runs over a printed document when minifying. */\nexport const minifyHtml: DeferredPassHandler = async code => {\n const [minified, minifyError] = await minifyHtmlTerser(code);\n if (minifyError) throw minifyError;\n\n return minified;\n};\n\n/** Hands `formatHtml` to a caller that would rather run it somewhere else. */\nexport const formatHtmlPass = (payload: FormatHtmlPayload): DeferredPass => coreDeferredPass(\"formatHtml\", payload);\n\n/** Hands `minifyHtml` to a caller that would rather run it somewhere else. */\nexport const minifyHtmlPass = (): DeferredPass => coreDeferredPass(\"minifyHtml\");\n","import { coreDeferredPass } from \"../../../helpers/deferred-pass.ts\";\nimport { formatCode } from \"../../../helpers/format-code.ts\";\n\nimport type { DeferredPass, DeferredPassHandler } from \"@staticbolt/core\";\n\nexport interface FormatMarkdownPayload {\n /** Where the document lives in the project, for Prettier to resolve its config against. */\n filePath: string;\n}\n\n/** The pass `coreMarkdownPlugin` runs over a printed document when formatting. */\nexport const formatMarkdown: DeferredPassHandler<FormatMarkdownPayload> = async (code, { filePath }) => {\n const [formatted, formatError] = await formatCode(code, filePath, \"markdown\");\n if (formatError) throw formatError;\n\n return formatted;\n};\n\n/** Hands `formatMarkdown` to a caller that would rather run it somewhere else. */\nexport const formatMarkdownPass = (payload: FormatMarkdownPayload): DeferredPass => coreDeferredPass(\"formatMarkdown\", payload);\n","import type { ValueOrError } from \"../../../utilities/value-or-error.ts\";\n\n/**\n * Minification is pure, and the same inline script can appear on many pages (e.g. through layouts), so cache results by content.\n * Only populated in production builds, where minification runs; SWC is imported lazily for the same reason.\n */\nconst swcCache = new Map<string, string>();\n\nexport async function minifyScriptSWC(code: string, isModule: boolean): Promise<ValueOrError<string>> {\n const key = (isModule ? \"m\" : \"s\") + code;\n\n const cached = swcCache.get(key);\n if (cached !== undefined) {\n return [cached, null];\n }\n\n try {\n const { minifySync: swcMinify } = await import(\"@swc/core\");\n const minified = swcMinify(code, { module: isModule });\n\n if (!minified.code) {\n return [null, new Error(\"Failed to minify script: empty output\")];\n }\n\n swcCache.set(key, minified.code);\n\n return [minified.code, null];\n } catch (error) {\n return [null, error as Error];\n }\n}\n","import { coreDeferredPass } from \"../../../helpers/deferred-pass.ts\";\nimport { formatCode } from \"../../../helpers/format-code.ts\";\nimport { minifyScriptSWC } from \"./minify-script.ts\";\n\nimport type { DeferredPass, DeferredPassHandler } from \"@staticbolt/core\";\n\nexport interface FormatScriptPayload {\n /** Where the script lives in the project, for Prettier to resolve its config against. */\n filePath: string;\n}\n\nexport interface MinifyScriptPayload {\n /** Whether the file is a module rather than a classic script, which SWC has to be told. */\n module: boolean;\n}\n\n/** The pass `coreScriptPlugin` runs over printed code when formatting. */\nexport const formatScript: DeferredPassHandler<FormatScriptPayload> = async (code, { filePath }) => {\n const [formatted, formatError] = await formatCode(code, filePath, \"js\");\n if (formatError) throw formatError;\n\n return formatted;\n};\n\n/** The pass `coreScriptPlugin` runs over printed code when minifying. */\nexport const minifyScript: DeferredPassHandler<MinifyScriptPayload> = async (code, { module }) => {\n const [minified, minifyError] = await minifyScriptSWC(code, module);\n if (minifyError) throw minifyError;\n\n return minified;\n};\n\n/** Hands `formatScript` to a caller that would rather run it somewhere else. */\nexport const formatScriptPass = (payload: FormatScriptPayload): DeferredPass => coreDeferredPass(\"formatScript\", payload);\n\n/** Hands `minifyScript` to a caller that would rather run it somewhere else. */\nexport const minifyScriptPass = (payload: MinifyScriptPayload): DeferredPass => coreDeferredPass(\"minifyScript\", payload);\n","import type { ValueOrError } from \"../../../utilities/value-or-error.ts\";\nimport type { Targets } from \"lightningcss\";\n\n/**\n * Minification is pure, and the same inline style can appear on many pages (e.g. through layouts), so cache results by content.\n * Only populated in production builds, where minification runs; lightningcss is imported lazily for the same reason.\n */\nconst lightningCssCache = new Map<string, string>();\n\nexport async function minifyLightingCss(code: string, filename: string, targets?: Targets): Promise<ValueOrError<string>> {\n const cached = lightningCssCache.get(code);\n if (cached !== undefined) {\n return [cached, null];\n }\n\n try {\n const { transform } = await import(\"lightningcss\");\n\n const results = transform({\n filename,\n code: Buffer.from(code),\n minify: true,\n analyzeDependencies: false,\n targets,\n });\n\n const minified = results.code.toString();\n lightningCssCache.set(code, minified);\n\n return [minified, null];\n } catch (error) {\n return [null, error as Error];\n }\n}\n","import { coreDeferredPass } from \"../../../helpers/deferred-pass.ts\";\nimport { formatCode } from \"../../../helpers/format-code.ts\";\nimport { minifyLightingCss } from \"./minify-style.ts\";\n\nimport type { DeferredPass, DeferredPassHandler } from \"@staticbolt/core\";\nimport type { Targets } from \"lightningcss\";\n\nexport interface FormatStylePayload {\n /** Where the stylesheet lives in the project, for Prettier to resolve its config against. */\n filePath: string;\n}\n\nexport interface MinifyStylePayload {\n filePath: string;\n\n /** The project's browserslist, already resolved into what Lightning CSS expects. */\n targets: Targets | undefined;\n}\n\n/** The pass `coreStylePlugin` runs over a printed stylesheet when formatting. */\nexport const formatStyle: DeferredPassHandler<FormatStylePayload> = async (code, { filePath }) => {\n const [formatted, formatError] = await formatCode(code, filePath, \"css\");\n if (formatError) throw formatError;\n\n return formatted;\n};\n\n/** The pass `coreStylePlugin` runs over a printed stylesheet when minifying. */\nexport const minifyStyle: DeferredPassHandler<MinifyStylePayload> = async (code, { filePath, targets }) => {\n const [minified, minifyError] = await minifyLightingCss(code, filePath, targets);\n if (minifyError) throw minifyError;\n\n return minified;\n};\n\n/** Hands `formatStyle` to a caller that would rather run it somewhere else. */\nexport const formatStylePass = (payload: FormatStylePayload): DeferredPass => coreDeferredPass(\"formatStyle\", payload);\n\n/** Hands `minifyStyle` to a caller that would rather run it somewhere else. */\nexport const minifyStylePass = (payload: MinifyStylePayload): DeferredPass => coreDeferredPass(\"minifyStyle\", payload);\n","import { coreDeferredPass } from \"../../../helpers/deferred-pass.ts\";\nimport { formatCode } from \"../../../helpers/format-code.ts\";\nimport { minifyHtmlTerser } from \"../html-metadata/minify-html.ts\";\n\nimport type { DeferredPass, DeferredPassHandler } from \"@staticbolt/core\";\n\nexport interface FormatSvgPayload {\n /** Where the drawing lives in the project, for Prettier to resolve its config against. */\n filePath: string;\n}\n\n/** The pass `coreSvgPlugin` runs over a printed drawing when formatting. */\nexport const formatSvg: DeferredPassHandler<FormatSvgPayload> = async (code, { filePath }) => {\n const [formatted, formatError] = await formatCode(code, filePath, \"html\");\n if (formatError) throw formatError;\n\n return formatted;\n};\n\n/** The pass `coreSvgPlugin` runs over a printed drawing when minifying. */\nexport const minifySvg: DeferredPassHandler = async code => {\n const [minified, minifyError] = await minifyHtmlTerser(code);\n if (minifyError) throw minifyError;\n\n return minified;\n};\n\n/** Hands `formatSvg` to a caller that would rather run it somewhere else. */\nexport const formatSvgPass = (payload: FormatSvgPayload): DeferredPass => coreDeferredPass(\"formatSvg\", payload);\n\n/** Hands `minifySvg` to a caller that would rather run it somewhere else. */\nexport const minifySvgPass = (): DeferredPass => coreDeferredPass(\"minifySvg\");\n"],"mappings":";AAKA,MAAM,iBAA0B,EAAE,YAAY,IAAI;;;;;;AAOlD,MAAM,kCAAkB,IAAI,IAAqB;;AAGjD,eAAsB,WAAW,MAAc,UAAkB,MAA2C;CAC1G,MAAM,EAAE,WAAW,MAAM,OAAO;CAEhC,IAAI;EACF,MAAM,UAAU,MAAM,mBAAmB,QAAQ;EAEjD,MAAM,SAAS,SAAS,OAAO,UAAU,SAAS,OAAO,eAAe;EAGxE,OAAO,CAAC,MAFoB,OAAO,MAAM;GAAE,GAAG;GAAS;GAAQ,UAAU;EAAS,CAAC,GAE5D,IAAI;CAC7B,QAAQ;EACN,OAAO,CAAC,sBAAM,IAAI,MAAM,mCAAmC,SAAS,EAAE,CAAC;CACzE;AACF;AAEA,eAAe,mBAAmB,UAAoC;CACpE,MAAM,SAAS,gBAAgB,IAAI,QAAQ;CAC3C,IAAI,QACF,OAAO;CAGT,MAAM,UAAU,MAAM,sBAAsB,QAAQ;CACpD,gBAAgB,IAAI,UAAU,OAAO;CAErC,OAAO;AACT;AAEA,eAAe,sBAAsB,UAAoC;CACvE,MAAM,EAAE,kBAAkB,MAAM,OAAO;CACvC,MAAM,kBAAkB,MAAM,OAAO;CAErC,IAA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AQ;GACR,qBAAqB;GACrB;EACF,CAEuB,CAAC,CAAC,KAAK,SAAS;EACvC,kBAAkB,IAAI,MAAM,QAAQ;EAEpC,OAAO,CAAC,UAAU,IAAI;CACxB,SAAS,OAAO;EACd,OAAO,CAAC,MAAM,KAAc;CAC9B;AACF;;;;;ACbA,MAAa,cAAuD,OAAO,MAAM,EAAE,eAAe;CAChG,MAAM,CAAC,WAAW,eAAe,MAAM,WAAW,MAAM,UAAU,KAAK;CACvE,IAAI,aAAa,MAAM;CAEvB,OAAO;AACT;;AAGA,MAAa,cAAuD,OAAO,MAAM,EAAE,UAAU,cAAc;CACzG,MAAM,CAAC,UAAU,eAAe,MAAM,kBAAkB,MAAM,UAAU,OAAO;CAC/E,IAAI,aAAa,MAAM;CAEvB,OAAO;AACT;;AAGA,MAAa,mBAAmB,YAA8C,iBAAiB,eAAe,OAAO;;AAGrH,MAAa,mBAAmB,YAA8C,iBAAiB,eAAe,OAAO;;;;;AC3BrH,MAAa,YAAmD,OAAO,MAAM,EAAE,eAAe;CAC5F,MAAM,CAAC,WAAW,eAAe,MAAM,WAAW,MAAM,UAAU,MAAM;CACxE,IAAI,aAAa,MAAM;CAEvB,OAAO;AACT;;AAGA,MAAa,YAAiC,OAAM,SAAQ;CAC1D,MAAM,CAAC,UAAU,eAAe,MAAM,iBAAiB,IAAI;CAC3D,IAAI,aAAa,MAAM;CAEvB,OAAO;AACT;;AAGA,MAAa,iBAAiB,YAA4C,iBAAiB,aAAa,OAAO;;AAG/G,MAAa,sBAAoC,iBAAiB,WAAW"}
@@ -0,0 +1,79 @@
1
+ import { DeferredPass, DeferredPassHandler } from "@staticbolt/core";
2
+ import { Targets } from "lightningcss";
3
+ //#region src/plugins/core-plugins/html-metadata/deferred.d.ts
4
+ interface FormatHtmlPayload {
5
+ /** Where the document lives in the project, for Prettier to resolve its config against. */
6
+ filePath: string;
7
+ }
8
+ /** The pass `coreHtmlPlugin` runs over a printed document when formatting. */
9
+ declare const formatHtml: DeferredPassHandler<FormatHtmlPayload>;
10
+ /** The pass `coreHtmlPlugin` runs over a printed document when minifying. */
11
+ declare const minifyHtml: DeferredPassHandler;
12
+ /** Hands `formatHtml` to a caller that would rather run it somewhere else. */
13
+ declare const formatHtmlPass: (payload: FormatHtmlPayload) => DeferredPass;
14
+ /** Hands `minifyHtml` to a caller that would rather run it somewhere else. */
15
+ declare const minifyHtmlPass: () => DeferredPass;
16
+ //#endregion
17
+ //#region src/plugins/core-plugins/markdown-metadata/deferred.d.ts
18
+ interface FormatMarkdownPayload {
19
+ /** Where the document lives in the project, for Prettier to resolve its config against. */
20
+ filePath: string;
21
+ }
22
+ /** The pass `coreMarkdownPlugin` runs over a printed document when formatting. */
23
+ declare const formatMarkdown: DeferredPassHandler<FormatMarkdownPayload>;
24
+ /** Hands `formatMarkdown` to a caller that would rather run it somewhere else. */
25
+ declare const formatMarkdownPass: (payload: FormatMarkdownPayload) => DeferredPass;
26
+ //#endregion
27
+ //#region src/plugins/core-plugins/script-metadata/deferred.d.ts
28
+ interface FormatScriptPayload {
29
+ /** Where the script lives in the project, for Prettier to resolve its config against. */
30
+ filePath: string;
31
+ }
32
+ interface MinifyScriptPayload {
33
+ /** Whether the file is a module rather than a classic script, which SWC has to be told. */
34
+ module: boolean;
35
+ }
36
+ /** The pass `coreScriptPlugin` runs over printed code when formatting. */
37
+ declare const formatScript: DeferredPassHandler<FormatScriptPayload>;
38
+ /** The pass `coreScriptPlugin` runs over printed code when minifying. */
39
+ declare const minifyScript: DeferredPassHandler<MinifyScriptPayload>;
40
+ /** Hands `formatScript` to a caller that would rather run it somewhere else. */
41
+ declare const formatScriptPass: (payload: FormatScriptPayload) => DeferredPass;
42
+ /** Hands `minifyScript` to a caller that would rather run it somewhere else. */
43
+ declare const minifyScriptPass: (payload: MinifyScriptPayload) => DeferredPass;
44
+ //#endregion
45
+ //#region src/plugins/core-plugins/style-metadata/deferred.d.ts
46
+ interface FormatStylePayload {
47
+ /** Where the stylesheet lives in the project, for Prettier to resolve its config against. */
48
+ filePath: string;
49
+ }
50
+ interface MinifyStylePayload {
51
+ filePath: string;
52
+ /** The project's browserslist, already resolved into what Lightning CSS expects. */
53
+ targets: Targets | undefined;
54
+ }
55
+ /** The pass `coreStylePlugin` runs over a printed stylesheet when formatting. */
56
+ declare const formatStyle: DeferredPassHandler<FormatStylePayload>;
57
+ /** The pass `coreStylePlugin` runs over a printed stylesheet when minifying. */
58
+ declare const minifyStyle: DeferredPassHandler<MinifyStylePayload>;
59
+ /** Hands `formatStyle` to a caller that would rather run it somewhere else. */
60
+ declare const formatStylePass: (payload: FormatStylePayload) => DeferredPass;
61
+ /** Hands `minifyStyle` to a caller that would rather run it somewhere else. */
62
+ declare const minifyStylePass: (payload: MinifyStylePayload) => DeferredPass;
63
+ //#endregion
64
+ //#region src/plugins/core-plugins/svg-metadata/deferred.d.ts
65
+ interface FormatSvgPayload {
66
+ /** Where the drawing lives in the project, for Prettier to resolve its config against. */
67
+ filePath: string;
68
+ }
69
+ /** The pass `coreSvgPlugin` runs over a printed drawing when formatting. */
70
+ declare const formatSvg: DeferredPassHandler<FormatSvgPayload>;
71
+ /** The pass `coreSvgPlugin` runs over a printed drawing when minifying. */
72
+ declare const minifySvg: DeferredPassHandler;
73
+ /** Hands `formatSvg` to a caller that would rather run it somewhere else. */
74
+ declare const formatSvgPass: (payload: FormatSvgPayload) => DeferredPass;
75
+ /** Hands `minifySvg` to a caller that would rather run it somewhere else. */
76
+ declare const minifySvgPass: () => DeferredPass;
77
+ //#endregion
78
+ export { FormatHtmlPayload, FormatMarkdownPayload, FormatScriptPayload, FormatStylePayload, FormatSvgPayload, MinifyScriptPayload, MinifyStylePayload, formatHtml, formatHtmlPass, formatMarkdown, formatMarkdownPass, formatScript, formatScriptPass, formatStyle, formatStylePass, formatSvg, formatSvgPass, minifyHtml, minifyHtmlPass, minifyScript, minifyScriptPass, minifyStyle, minifyStylePass, minifySvg, minifySvgPass };
79
+ //# sourceMappingURL=deferred.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deferred.d.mts","names":[],"sources":["../src/plugins/core-plugins/html-metadata/deferred.ts","../src/plugins/core-plugins/markdown-metadata/deferred.ts","../src/plugins/core-plugins/script-metadata/deferred.ts","../src/plugins/core-plugins/style-metadata/deferred.ts","../src/plugins/core-plugins/svg-metadata/deferred.ts"],"mappings":";;;UAMiB;;EAEf;;;cAIW,YAAY,oBAAoB;;cAQhC,YAAY;;cAQZ,iBAAkB,SAAS,sBAAoB;;cAG/C,sBAAqB;;;UC1BjB;;EAEf;;;cAIW,gBAAgB,oBAAoB;;cAQpC,qBAAsB,SAAS,0BAAwB;;;UCbnD;;EAEf;;UAGe;;EAEf;;;cAIW,cAAc,oBAAoB;;cAQlC,cAAc,oBAAoB;;cAQlC,mBAAoB,SAAS,wBAAsB;;cAGnD,mBAAoB,SAAS,wBAAsB;;;UC7B/C;;EAEf;;UAGe;EACf;;EAGA,SAAS;;;cAIE,aAAa,oBAAoB;;cAQjC,aAAa,oBAAoB;;cAQjC,kBAAmB,SAAS,uBAAqB;;cAGjD,kBAAmB,SAAS,uBAAqB;;;UCjC7C;;EAEf;;;cAIW,WAAW,oBAAoB;;cAQ/B,WAAW;;cAQX,gBAAiB,SAAS,qBAAmB;;cAG7C,qBAAoB"}
@@ -0,0 +1,3 @@
1
+ import { _ as minifyHtml, a as formatStyle, c as minifyStylePass, d as minifyScript, f as minifyScriptPass, g as formatHtmlPass, h as formatHtml, i as minifySvgPass, l as formatScript, m as formatMarkdownPass, n as formatSvgPass, o as formatStylePass, p as formatMarkdown, r as minifySvg, s as minifyStyle, t as formatSvg, u as formatScriptPass, v as minifyHtmlPass } from "./deferred-DTj91vEg.mjs";
2
+
3
+ export { formatHtml, formatHtmlPass, formatMarkdown, formatMarkdownPass, formatScript, formatScriptPass, formatStyle, formatStylePass, formatSvg, formatSvgPass, minifyHtml, minifyHtmlPass, minifyScript, minifyScriptPass, minifyStyle, minifyStylePass, minifySvg, minifySvgPass };