diff --git a/packages/ui-templates/lib/render.ts b/packages/ui-templates/lib/render.ts index 1a84819a1b..a409023f2f 100644 --- a/packages/ui-templates/lib/render.ts +++ b/packages/ui-templates/lib/render.ts @@ -33,8 +33,9 @@ export const RenderPlugin = () => { // Read source template let html = await fsp.readFile(fileName, 'utf-8') + const isCompleteHTML = html.includes('') - // Apply criters to inline styles + // Apply critters to inline styles html = await critters.process(html) // We no longer need references to external CSS html = html.replace(/]*>/g, '') @@ -63,6 +64,11 @@ export const RenderPlugin = () => { // Minify HTML html = htmlMinifier.minify(html, { collapseWhitespace: true }) + if (!isCompleteHTML) { + html = html.replace('
', '') + html = html.replace('', '') + } + // Load messages const messages = JSON.parse(await fsp.readFile(r(`templates/${templateName}/messages.json`), 'utf-8')) diff --git a/packages/ui-templates/templates/spa-loading-icon/index.html b/packages/ui-templates/templates/spa-loading-icon/index.html new file mode 100644 index 0000000000..c698cfc761 --- /dev/null +++ b/packages/ui-templates/templates/spa-loading-icon/index.html @@ -0,0 +1,29 @@ + + diff --git a/packages/ui-templates/templates/spa-loading-icon/messages.json b/packages/ui-templates/templates/spa-loading-icon/messages.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/ui-templates/templates/spa-loading-icon/messages.json @@ -0,0 +1 @@ +{}