Easily include file content in another file with reserved <file> tag. This is the default preview behavior and currently there's no way to disable it.
<file>
<file src="data.json"></file> <file src='response.json'></file>
Below snippet is also valid. You can include other file anywhere in your code.
<script> let gameData = <file src="data.json"></file>; </script>
File path is relative to file that's calling the <file> tag. Consider the following example :
Example directory structure : |- index.html |- view/ |---- modals.html |---- template.html
Insert file content of view/modals.html in index.html.
view/modals.html
index.html
<!-- index.html relative path --> <file src="view/modals.html"></file>
Insert file content of view/template.html in view/modals.html.
view/template.html
<!-- modals.html relative path --> <file src="template.html"></file>
Codetmp will scan to the last file which is included by <file> tag then starts replacing content up to the parent file.
There was an error while loading. Please reload this page.