Default commenting method

note: I mean to target especially non editable(from bss) exported script/document…

I recently using my own regex(php) to make cache bss exported to be a single line file…
the problem here is there are commented javasript(light dark theme) that are using ‘//’…

it’s easy to make regex recognised that pattern… however I think to use /* */ (or any that have opening and closing comment) would definitely prefereable standard…
so, in case that if I would, in somepoint, to make it single line any document but to leave commented line stays to the shipped document…

just incase if someone trying to point out why would I use regex to single line the exported document, while bss can compress it on export…
NO…
I especially create this topic, because the feature doesn’t work in some case(but not limited to, bss theme switcher, header contents, custom codes, after-exported-server-side-generated-text)…
perhaps it’s a feature and not bugs…
but the feature became a problem when we cannot control it before exporting(in this case theme switcher)…

point:
can we standardize any bss non-editable component comment method to self closing (eg: ‘/* */’) instead of only the opening (eg: ‘//’)

Thank you for the suggestion! Wouldn’t it be easier to remove the comments before minification? Just strip all lines starting with // from the page on the first step?

1 Like

well yes, if it’s editable on bss…
what I encountered in the bss new theme-switcher cannot be edited(before export)…

right now my solution would use regex to detect comment(which in this case only have opening)…
but when in somecase that we need to only just to single-line it(without deleting comment), it became problem… as in it have closing, the rest of the page become commented…

there are work around, yes, by changed any comment to self closing one AFTER-EXPORT using string replace using regex…
but it would still be prefferable if the standard of any comment on non-editable-component to be self closing…

for now deleting after-export using regex is working