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

Improve glob.js

Added constant `supportsGlob` to provide a boolean to check if a glob function is available.
This commit is contained in:
Chauncey McAskill
2022-03-29 21:06:34 -04:00
parent a4656f59ed
commit 0738dd6491
2 changed files with 5 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
import loconfig from '../utils/config.js';
import glob from '../utils/glob.js';
import glob, { supportsGlob } from '../utils/glob.js';
import message from '../utils/message.js';
import notification from '../utils/notification.js';
import resolve from '../utils/template.js';
@@ -64,7 +64,7 @@ export const productionConcatFilesArgs = [
* @return {Promise}
*/
export default async function concatFiles(globOptions = null, concatOptions = null) {
if (glob) {
if (supportsGlob) {
if (globOptions == null) {
globOptions = productionGlobOptions;
} else if (
@@ -105,7 +105,7 @@ export default async function concatFiles(globOptions = null, concatOptions = nu
includes = resolve(includes);
outfile = resolve(outfile);
if (glob && globOptions) {
if (supportsGlob && globOptions) {
includes = await glob(includes, globOptions);
}