fix: concat sources so that 'code' has them all
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
dea30c1397
commit
4de5c5fde3
@ -48,10 +48,19 @@ const composeFunctions = (...fns) =>
|
||||
fns.map(applyFunction).reduce((f, g) => x => f(x).then(g));
|
||||
|
||||
function buildSourceMap(files) {
|
||||
return files.reduce((sources, file) => {
|
||||
sources[file.name] = file.source || file.contents;
|
||||
return sources;
|
||||
}, {});
|
||||
// TODO: concatenating the source/contents is a quick hack for multi-file
|
||||
// editing. It is used because all the files (js, html and css) end up with
|
||||
// the same name 'index'. This made the last file the only file to appear in
|
||||
// sources.
|
||||
// A better solution is to store and handle them separately. Perhaps never
|
||||
// setting the name to 'index'.
|
||||
return files.reduce(
|
||||
(sources, file) => {
|
||||
sources[file.name] += file.source || file.contents;
|
||||
return sources;
|
||||
},
|
||||
{ index: '' }
|
||||
);
|
||||
}
|
||||
|
||||
function checkFilesErrors(files) {
|
||||
|
Reference in New Issue
Block a user