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));
|
fns.map(applyFunction).reduce((f, g) => x => f(x).then(g));
|
||||||
|
|
||||||
function buildSourceMap(files) {
|
function buildSourceMap(files) {
|
||||||
return files.reduce((sources, file) => {
|
// TODO: concatenating the source/contents is a quick hack for multi-file
|
||||||
sources[file.name] = file.source || file.contents;
|
// 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;
|
return sources;
|
||||||
}, {});
|
},
|
||||||
|
{ index: '' }
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkFilesErrors(files) {
|
function checkFilesErrors(files) {
|
||||||
|
Reference in New Issue
Block a user