Skip to content

Commit

Permalink
fix(terser): terser_minified should support .mjs files when running o…
Browse files Browse the repository at this point in the history
…n 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"]
```
  • Loading branch information
gregmagolan authored and alexeagle committed Oct 11, 2019
1 parent dfefc11 commit 6b09b51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/terser/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function terserDirectory(input, output, residual, terserBinary) {
}

fs.readdirSync(input).forEach(f => {
if (f.endsWith('.js')) {
if (path.extname(f) === '.js' || path.extname(f) === '.mjs') {
const inputFile = path.join(input, path.basename(f));
const outputFile = path.join(output, path.basename(f));

Expand Down

0 comments on commit 6b09b51

Please sign in to comment.