Skip to content

Commit c189b0f

Browse files
committed
fix(cms-config): properly prepend file paths with nuxt srcDir
fixes #18
1 parent c3889ff commit c189b0f

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Diff for: src/configManager.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,25 @@ class ConfigManager {
7575

7676
if (configObject.collections) {
7777
configObject.collections.forEach(function(collection) {
78-
collection.folder &&
78+
if (collection.folder) {
7979
newConfig.collections.push({
8080
...collection,
8181
folder: join(enforcedPath, collection.folder)
8282
});
83+
} else if (collection.files) {
84+
const collectionFiles = [];
85+
collection.files.forEach(function(fileEntry) {
86+
fileEntry.file &&
87+
collectionFiles.push({
88+
...fileEntry,
89+
file: join(enforcedPath, fileEntry.file)
90+
});
91+
});
92+
newConfig.collections.push({
93+
...collection,
94+
files: collectionFiles
95+
});
96+
}
8397
});
8498
}
8599

0 commit comments

Comments
 (0)