Commit a0587215 authored by chriseth's avatar chriseth

Merge pull request #27 from redsquirrel/patch-1

Improving imports
parents 2222e0b1 4e01bcfb
......@@ -708,7 +708,7 @@ var run = function() {
cb(files[fileNameFromKey(SOL_CACHE_FILE)]);
return;
}
var importRegex = /import\s[\'\"]([^\'\"]+)[\'\"];/g;
var importRegex = /^\s*import\s*[\'\"]([^\'\"]+)[\'\"];/g;
var reloop = false;
do {
reloop = false;
......@@ -723,6 +723,9 @@ var run = function() {
if (getFiles().indexOf(fileKey(m)) !== -1) {
files[m] = window.localStorage[fileKey(m)];
reloop = true;
} else if (m.startsWith('./') && getFiles().indexOf(fileKey(m.slice(2))) !== -1) {
files[m] = window.localStorage[fileKey(m.slice(2))];
reloop = true;
} else if (m in cachedRemoteFiles) {
files[m] = cachedRemoteFiles[m];
reloop = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment