Skip to content

Commit 6b09b51

Browse files
gregmagolanalexeagle
authored andcommitted
fix(terser): terser_minified should support .mjs files when running on directory (#1264)
Directory mode should match file mode which already allows .mjs files ``` def _filter_js(files): return [f for f in files if f.is_directory or f.extension == "js" or f.extension == "mjs"] ```
1 parent dfefc11 commit 6b09b51

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/terser/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function terserDirectory(input, output, residual, terserBinary) {
110110
}
111111

112112
fs.readdirSync(input).forEach(f => {
113-
if (f.endsWith('.js')) {
113+
if (path.extname(f) === '.js' || path.extname(f) === '.mjs') {
114114
const inputFile = path.join(input, path.basename(f));
115115
const outputFile = path.join(output, path.basename(f));
116116

0 commit comments

Comments
 (0)