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:
@@ -18,6 +18,10 @@ try {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
loconfig.data = (loconfig.data ?? {});
|
||||
loconfig.paths = (loconfig.paths ?? {});
|
||||
loconfig.tasks = (loconfig.tasks ?? {});
|
||||
|
||||
export default loconfig;
|
||||
|
||||
export {
|
||||
|
||||
@@ -9,7 +9,8 @@ import {
|
||||
} from '../utils/index.js';
|
||||
|
||||
const templateData = flatten({
|
||||
paths: loconfig.paths
|
||||
...loconfig.data,
|
||||
paths: loconfig.paths,
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user