diff --git a/html.js b/html.js index 02e2481..cc17daf 100644 --- a/html.js +++ b/html.js @@ -1,3 +1,15 @@ +var loadingSpinnerCode = ` + + +`; + var generateIndexHtmlContent = ({ bootScriptPath = "", bootScript = "", @@ -9,6 +21,7 @@ var generateIndexHtmlContent = ({ inlineCssLink = [], inlineJsSrc = [], offline = false, + withLoadingSpinner = false, resourceRoots = { projectNameSpace: "." } }) => { @@ -43,31 +56,28 @@ var generateIndexHtmlContent = ({ return ` - + - - ${title} - - - ${jsSrcs} + ${title} - ${cssLinks} - - - ${sBootScript} - - - `; + + +${withLoadingSpinner ? loadingSpinnerCode : ""} + +${sBootScript} +${jsSrcs} +${cssLinks} +`; }; module.exports = { generateIndexHtmlContent }; diff --git a/index.js b/index.js index edd6f74..1a0d8ea 100644 --- a/index.js +++ b/index.js @@ -36,6 +36,7 @@ module.exports = function({ theme, title, production = false, + withLoadingSpinner = false, bootScript, bootScriptPath, offline = false, @@ -262,6 +263,7 @@ module.exports = function({ bootScriptPath, preload, offline, + withLoadingSpinner, inlineCssLink: cssLinks, resourceRoots: { [projectNameSpace]: ".",