Ran into this error, then renamed file to ".mjs", but still got this error:
$ npx minify fff.mjs --mangle.topLevel --outFile fff.min.mjs
SyntaxError: unknown: 'import' and 'export' may appear only with 'sourceType: "module"' (1:0)
Consider renaming the file to '.mjs', or setting sourceType:module or sourceType:unambiguous in your Babel config for this file.
> 1 | export let aaa = function(){};
| ^
2 |
Environment: Node.js v10.1
Ran into this error, then renamed file to ".mjs", but still got this error:
Environment: Node.js v10.1