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

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"
            }
        ]
    }
}
```
This commit is contained in:
Chauncey McAskill
2022-10-13 15:01:29 -04:00
parent 8aac2ffea6
commit 89ce8ce1ad
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,
});
/**