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

Refactor template.js

Added:
- Function `resolve()` to process any template tags (in a string) in objects and arrays.

Changed:
- Renamed function `template()` to `resolveValue()`.
- Replaced default export `resolveValue()` with new function `resolve()`.
This commit is contained in:
Chauncey McAskill
2022-03-22 16:08:29 -04:00
parent d49d3eabb2
commit 48bd911804
6 changed files with 63 additions and 25 deletions

View File

@@ -2,7 +2,7 @@ import loconfig from '../../loconfig.json';
import glob from '../utils/glob.js';
import message from '../utils/message.js';
import notification from '../utils/notification.js';
import template from '../utils/template.js';
import resolve from '../utils/template.js';
import concat from 'concat';
import {
basename,
@@ -98,8 +98,8 @@ export default async function concatFiles(globOptions = null, concatOptions = nu
console.time(timeLabel);
try {
includes = includes.map((path) => template(path));
outfile = template(outfile);
includes = resolve(includes);
outfile = resolve(outfile);
let files;