Skip to content

Commit c3e7e61

Browse files
committed
chore: use CSS/JS comments for build placeholders
Avoids false editor errors from HTML comments inside style/script tags.
1 parent e3ff8e5 commit c3e7e61

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

scripts/build.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let html = fs.readFileSync(path.join(SRC, 'html', 'configurator.html'), 'utf8');
1010

1111
// 2. Inline CSS
1212
const css = fs.readFileSync(path.join(SRC, 'css', 'styles.css'), 'utf8');
13-
const cssPlaceholder = '<!-- BUILD:CSS -->';
13+
const cssPlaceholder = '/* BUILD:CSS */';
1414
html = html.slice(0, html.indexOf(cssPlaceholder)) + css.trimEnd() + html.slice(html.indexOf(cssPlaceholder) + cssPlaceholder.length);
1515

1616
// 3. Collect service module files (all .js in services/ except index.js, sorted)
@@ -69,7 +69,7 @@ if (lambdaIdx === -1) {
6969
}
7070
jsBundle = jsBundle.slice(0, lambdaIdx) + lambdaIndented.trimEnd() + jsBundle.slice(lambdaIdx + lambdaPlaceholder.length);
7171

72-
const jsPlaceholder = '<!-- BUILD:JS -->';
72+
const jsPlaceholder = '/* BUILD:JS */';
7373
html = html.slice(0, html.indexOf(jsPlaceholder)) + jsBundle.trimEnd() + html.slice(html.indexOf(jsPlaceholder) + jsPlaceholder.length);
7474

7575
// 5. Write output

scripts/verify-build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const checks = [
1414
[html.includes('deleteGenerate'), 'delete flow present'],
1515
[html.includes('editorGenerate'), 'editor flow present'],
1616
[html.includes('editorGenerateUpgrade'),'upgrade flow present'],
17-
[!html.includes('<!-- BUILD:'), 'no unresolved build placeholders'],
17+
[!html.includes('/* BUILD:'), 'no unresolved build placeholders'],
1818
[!html.includes('require('), 'no require() in output'],
1919
];
2020

src/html/configurator.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
88
<title>MAP 2.0 Auto-Tagger Configurator</title>
99
<style>
10-
<!-- BUILD:CSS -->
10+
/* BUILD:CSS */
1111
</style>
1212
</head>
1313
<body>
@@ -958,7 +958,7 @@ <h3 style="margin:20px 0 8px;font-size:14px;" data-i18n="ui_editor_script_previe
958958
</div>
959959

960960
<script>
961-
<!-- BUILD:JS -->
961+
/* BUILD:JS */
962962
</script>
963963
</body>
964964
</html>

0 commit comments

Comments
 (0)