Skip to content

Commit

Permalink
fix(cms-config): properly prepend file paths with nuxt srcDir
Browse files Browse the repository at this point in the history
fixes #18
  • Loading branch information
medfreeman committed Sep 18, 2017
1 parent c3889ff commit c189b0f
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/configManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,25 @@ class ConfigManager {

if (configObject.collections) {
configObject.collections.forEach(function(collection) {
collection.folder &&
if (collection.folder) {
newConfig.collections.push({
...collection,
folder: join(enforcedPath, collection.folder)
});
} else if (collection.files) {
const collectionFiles = [];
collection.files.forEach(function(fileEntry) {
fileEntry.file &&
collectionFiles.push({
...fileEntry,
file: join(enforcedPath, fileEntry.file)
});
});
newConfig.collections.push({
...collection,
files: collectionFiles
});
}
});
}

Expand Down

0 comments on commit c189b0f

Please sign in to comment.