diff --git a/build.ts b/build.ts index eec1dc6..6726024 100644 --- a/build.ts +++ b/build.ts @@ -1,11 +1,14 @@ import * as fs from 'fs-extra' import * as path from 'path' +import * as util from 'util' import * as glob from 'glob' import chalk from 'chalk' import gzipSize from 'gzip-size' import brotliSize from 'brotli-size' import formatNumber from 'format-number' import { getBorderCharacters, table } from 'table' +// @ts-ignore +import validateHtml from 'html-tag-validator' const sourceFolder = 'src' const distFolder = 'dist' @@ -41,7 +44,15 @@ async function buildAll (sourceFolder: string, distFolder: string) { } async function buildHtml (sourceFolder: string, distFolder: string) { - fs.copySync(`${sourceFolder}/index.html`, `${distFolder}/index.html`) + const sourceFilePath = `${sourceFolder}/index.html` + const sourceFileContent = fs.readFileSync(sourceFilePath, 'utf-8') + try { + const result = await util.promisify(validateHtml)(sourceFileContent) + console.log(result) + fs.copySync(sourceFilePath, `${distFolder}/index.html`) + } catch (e) { + console.error(e) + } } async function buildJavaScript (sourceFolder: string, distFolder: string) { diff --git a/package.json b/package.json index e223e36..506d622 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "fs-extra": "^7.0.0", "glob": "^7.1.2", "gzip-size": "^5.0.0", + "html-tag-validator": "^1.6.0", "node-sass": "^4.9.3", "table": "^4.0.3", "typescript": "^3.0.1" diff --git a/src/index.html b/src/index.html index 15698e0..a7e6418 100644 --- a/src/index.html +++ b/src/index.html @@ -11,9 +11,9 @@ - - + fill="currentcolor" fill-rule="nonzero" mask="url(#b)"> + +

Wane

diff --git a/yarn.lock b/yarn.lock index ec8c2fb..cba3e1b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -470,6 +470,10 @@ hosted-git-info@^2.1.4: version "2.7.1" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" +html-tag-validator@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/html-tag-validator/-/html-tag-validator-1.6.0.tgz#ccd115ec3063595e2240985525d39732040f9b43" + http-signature@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"