From b5e083b84552a7bf9746b98861e93670d9367020 Mon Sep 17 00:00:00 2001 From: Seho <35763284+1018715564@users.noreply.github.com> Date: Fri, 11 Feb 2022 14:45:54 +0800 Subject: [PATCH] Added .mjs and .cjs support --- src/cli/utils/CLIUtils.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cli/utils/CLIUtils.ts b/src/cli/utils/CLIUtils.ts index a0a1a3495..f52a3a6e0 100644 --- a/src/cli/utils/CLIUtils.ts +++ b/src/cli/utils/CLIUtils.ts @@ -10,7 +10,9 @@ export class CLIUtils { */ public static readonly allowedConfigFileExtensions: string[] = [ '.js', - '.json' + '.json', + '.mjs', + '.cjs' ]; /** @@ -24,7 +26,7 @@ export class CLIUtils { const isValidExtension: boolean = CLIUtils.allowedConfigFileExtensions.includes(configFileExtension); if (!isValidExtension) { - throw new ReferenceError('Given config path must be a valid `.js` or `.json` file path'); + throw new ReferenceError('Given config path must be a valid `.js|.mjs|.cjs` or `.json` file path'); } try {