Skip to content

Commit 92535aa

Browse files
authored
Added .mjs and .cjs support (javascript-obfuscator#1059)
1 parent b99b6a4 commit 92535aa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/cli/utils/CLIUtils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ export class CLIUtils {
1010
*/
1111
public static readonly allowedConfigFileExtensions: string[] = [
1212
'.js',
13-
'.json'
13+
'.json',
14+
'.mjs',
15+
'.cjs'
1416
];
1517

1618
/**
@@ -24,7 +26,7 @@ export class CLIUtils {
2426
const isValidExtension: boolean = CLIUtils.allowedConfigFileExtensions.includes(configFileExtension);
2527

2628
if (!isValidExtension) {
27-
throw new ReferenceError('Given config path must be a valid `.js` or `.json` file path');
29+
throw new ReferenceError('Given config path must be a valid `.js|.mjs|.cjs` or `.json` file path');
2830
}
2931

3032
try {

0 commit comments

Comments
 (0)