1
0
mirror of https://github.com/locomotivemtl/locomotive-boilerplate.git synced 2026-01-15 00:55:08 +08:00

1 Commits

Author SHA1 Message Date
Chauncey McAskill
89ce8ce1ad Add support for arbitrary data in template tags
Where data is defined under a `data` field in 'loconfig.json'.

Example:

```json5
{
    "paths": {…},
    "data": {
        "foo": "b"
    },
    "tasks": {
        "concats": [
            {
                "includes": [
                    "{% paths.scripts.src %}/vendors/*.js"
                ],
                "outfile": "{% paths.scripts.dest %}/a{% foo %}c.js"
            }
        ]
    }
}
```
2023-03-23 10:27:04 -04:00
2 changed files with 6 additions and 1 deletions

View File

@@ -18,6 +18,10 @@ try {
// do nothing
}
loconfig.data = (loconfig.data ?? {});
loconfig.paths = (loconfig.paths ?? {});
loconfig.tasks = (loconfig.tasks ?? {});
export default loconfig;
export {

View File

@@ -9,7 +9,8 @@ import {
} from '../utils/index.js';
const templateData = flatten({
paths: loconfig.paths
...loconfig.data,
paths: loconfig.paths,
});
/**