Is it possible to get an option to select a file in the resources that can be copied to the scratch area and treated as an external file when in preview.
This would help in testing and avoid some of the CORS denials when previewing.
I can’t see that this would be very hard to do and it does work if you do this manually.
You would probably also need to add a no cache on the files…
Mock up of option. using the README.md file
Image 1,
Preview as external on export copies/aliases file to scratch ) - Off by default.
On ( allows previewing using the file outside of the hype resources and to be served by the Hype web server )
Copy as internal resource on export On by default.
Will be included in the hype resource folder as normal on export
Image 2,
**Preview as external on export - Checked On
Copy as internal resource on export Checked On
Image 3,
**Preview as external on export - Checked On
Copy as internal resource on export Checked Off,
Will Not be included in the hype resource folder as normal on export
How it would be used in the code.
function loadMDs(box,file){
var txtFile = new XMLHttpRequest();
txtFile.open("GET", "README.md", true);
txtFile.onreadystatechange = function() {
if (txtFile.readyState === 4) { ......
–
Preview export to scratch.
–
result in preview without getting a (CORS) cross domain denial.