@@ -21,18 +21,19 @@ std::string readFile(const std::filesystem::path& path)
2121
2222int main (int argc, char ** argv)
2323{
24- if (argc != 5 )
24+ if (argc != 6 )
2525 {
26- std::cout
27- << " Expected 4 argument: <index.html> <import_scripts> <import_styles> <import_scripts_defer >, but got "
28- << argc - 1 << " \n " ;
26+ std::cout << " Expected 4 argument: <index.html> <import_scripts> <import_styles> <import_scripts_defer> "
27+ " <lean_html >, but got "
28+ << argc - 1 << " \n " ;
2929 return 1 ;
3030 }
3131
3232 const auto index = std::filesystem::path{argv[1 ]};
3333 const auto importScripts = std::filesystem::path{argv[2 ]};
3434 const auto importStyles = std::filesystem::path{argv[3 ]};
3535 const auto importScriptsDefer = std::string{argv[4 ]} == " defer" ? true : false ;
36+ const auto leanHtml = std::string{argv[5 ]} == " lean" ? true : false ;
3637
3738 std::string indexHtml;
3839 try
@@ -57,8 +58,17 @@ int main(int argc, char** argv)
5758 relativeImportScriptsFile.generic_string () + " \" ;\n\t </script>\n " ;
5859 const std::string importStylesHtml =
5960 " \t <style>\n\t\t @import \" " + relativeImportStylesFile.generic_string () + " \" ;\n\t </style>\n " ;
60- const std::string importBinIndexHtml =
61- " \t <script type=\" module\" defer>\n\t\t import \" " + binIndex.generic_string () + " \" ;\n\t </script>\n " ;
61+
62+ std::string importBinIndexHtml;
63+ if (!leanHtml)
64+ {
65+ importBinIndexHtml =
66+ " \t <script type=\" module\" defer>\n\t\t import \" " + binIndex.generic_string () + " \" ;\n\t </script>\n " ;
67+ }
68+ else
69+ {
70+ importBinIndexHtml = " \t <script type=\" module\" defer src=\" " + binIndex.generic_string () + " \" ></script>\n " ;
71+ }
6272
6373 // find end of header </head> from behind in indexHtml:
6474 auto headEnd = indexHtml.rfind (" </head>" );
0 commit comments