@@ -996,7 +996,7 @@ const getResultPage = async ({
996996 } ,
997997 } ;
998998
999- const compileResults = await Promise . all ( [
999+ const [ styleCompileResult , testsCompileResult ] = await Promise . all ( [
10001000 compiler . compile ( styleContent , styleLanguage , config , {
10011001 html : `${ compiledMarkup } <script type="script-for-styles">${ compiledScript } </script>
10021002 <script type="script-for-styles">${ compileInfo . importedContent } </script>` ,
@@ -1008,8 +1008,7 @@ const getResultPage = async ({
10081008 : compiler . compile ( testsContent , testsLanguage , config , { } )
10091009 : Promise . resolve ( getCompileResult ( getCache ( ) . tests ?. compiled || '' ) ) ,
10101010 ] ) ;
1011-
1012- const [ compiledStyle , compiledTests ] = compileResults . map ( ( result ) => {
1011+ const [ compiledStyle , compiledTests ] = [ styleCompileResult , testsCompileResult ] . map ( ( result ) => {
10131012 const { code, info } = getCompileResult ( result ) ;
10141013 compileInfo = {
10151014 ...compileInfo ,
@@ -1027,10 +1026,12 @@ const getResultPage = async ({
10271026 markup : {
10281027 ...contentConfig . markup ,
10291028 compiled : compiledMarkup ,
1029+ modified : compiledMarkup ,
10301030 } ,
10311031 style : {
10321032 ...contentConfig . style ,
10331033 compiled : compiledStyle ,
1034+ modified : compiledStyle ,
10341035 } ,
10351036 script : {
10361037 ...contentConfig . script ,
@@ -1045,6 +1046,7 @@ const getResultPage = async ({
10451046 compiled : compiledTests ,
10461047 } ,
10471048 } ;
1049+ compiledCode . script . modified = compiledCode . script . compiled ;
10481050
10491051 if ( scriptType != null && scriptType !== 'module' ) {
10501052 singleFile = true ;
@@ -1063,6 +1065,14 @@ const getResultPage = async ({
10631065
10641066 const styleOnlyUpdate = sourceEditor === 'style' && ! compileInfo . cssModules ;
10651067
1068+ const logError = ( language : Language , errors : string [ ] = [ ] ) => {
1069+ errors . forEach ( ( err ) => toolsPane ?. console ?. error ( `[${ getLanguageTitle ( language ) } ] ${ err } ` ) ) ;
1070+ } ;
1071+ logError ( markupLanguage , markupCompileResult . info ?. errors ) ;
1072+ logError ( styleLanguage , styleCompileResult . info ?. errors ) ;
1073+ logError ( scriptLanguage , scriptCompileResult . info ?. errors ) ;
1074+ logError ( testsLanguage , getCompileResult ( testsCompileResult ) . info ?. errors ) ;
1075+
10661076 if ( singleFile ) {
10671077 setCache ( {
10681078 ...getCache ( ) ,
@@ -1124,17 +1134,9 @@ const flushResult = () => {
11241134 wat : ';; loading' ,
11251135 } ;
11261136
1127- updateCache (
1128- 'markup' ,
1129- compiledLanguages . markup ,
1130- loadingComments [ compiledLanguages . markup ] || 'html' ,
1131- ) ;
1132- updateCache ( 'style' , compiledLanguages . style , loadingComments [ compiledLanguages . style ] || 'css' ) ;
1133- updateCache (
1134- 'script' ,
1135- compiledLanguages . script ,
1136- loadingComments [ compiledLanguages . script ] || 'javascript' ,
1137- ) ;
1137+ updateCache ( 'markup' , compiledLanguages . markup , loadingComments [ compiledLanguages . markup ] ?? '' ) ;
1138+ updateCache ( 'style' , compiledLanguages . style , loadingComments [ compiledLanguages . style ] ?? '' ) ;
1139+ updateCache ( 'script' , compiledLanguages . script , loadingComments [ compiledLanguages . script ] ?? '' ) ;
11381140 setCache ( {
11391141 ...getCache ( ) ,
11401142 tests : {
0 commit comments