|
|
|
@ -288,7 +288,6 @@ THE SOFTWARE. |
|
|
|
|
$('#output').empty(); |
|
|
|
|
var input = editor.getValue(); |
|
|
|
|
var inputIncludingImports = includeLocalImports( input ); |
|
|
|
|
console.log( inputIncludingImports ) |
|
|
|
|
var optimize = document.querySelector('#optimize').checked; |
|
|
|
|
try { |
|
|
|
|
var data = $.parseJSON(compileJSON(inputIncludingImports, optimize ? 1 : 0)); |
|
|
|
@ -328,12 +327,11 @@ THE SOFTWARE. |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
function includeLocalImports( input ) { |
|
|
|
|
var importRegex = /import\s[\'\"]([^\'\"]+)[\'\"]/g |
|
|
|
|
var importRegex = /import\s[\'\"]([^\'\"]+)[\'\"];/g |
|
|
|
|
var imports = []; |
|
|
|
|
var matches = []; |
|
|
|
|
var match; |
|
|
|
|
while ((match = importRegex.exec(input)) !== null) { |
|
|
|
|
console.log("match:", match[0]) |
|
|
|
|
if (match[1] && solFiles.indexOf(match[1]) !== -1) { |
|
|
|
|
imports.push( match[1] ) |
|
|
|
|
matches.push( match[0] ) |
|
|
|
|