2021-12-25 14:39:47 +01:00
|
|
|
const path = require('path')
|
|
|
|
|
|
|
|
const makeSourceAbsolute = (dir, tree) => {
|
2024-05-08 13:16:23 +02:00
|
|
|
for (const component of Object.values(tree)) {
|
|
|
|
component.source = path.join(dir, component.file)
|
|
|
|
if (component.children) {
|
|
|
|
makeSourceAbsolute(dir, component.children)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return tree
|
2021-12-25 14:39:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
2024-05-08 13:16:23 +02:00
|
|
|
makeSourceAbsolute
|
|
|
|
}
|