repl: multiple dots in filename not supported when reloading a saved project

In REPL, if you reload a saved project with a file containing multiple dots (example.store.js), the file will be reload as 'example.store' and imports will break.
pull/4441/head
Alexan 6 years ago
parent 1772c3f7f1
commit 195cf17c3c

@ -57,7 +57,10 @@
is_relaxed_gist = data.relaxed;
const components = data.files.map(file => {
let [name, type] = file.name.split('.');
const dot = file.name.lastIndexOf(".");
let name = file.name.slice(0, dot);
let type = file.name.slice(dot + 1);
if (type === 'html') type = 'svelte'; // TODO do this on the server
return { name, type, source: file.source };
});

Loading…
Cancel
Save