feat: Support the .mjs extension by default. (#1023)

Fixes https://github.com/documentationjs/documentation/issues/1022.

`.mjs` is ordered before `.js` as that is the resolution order in other tools such as Webpack v4.
This commit is contained in:
Jayden Seric 2018-03-02 04:06:49 +11:00 committed by Tom MacWright
parent 487336fcd8
commit b8a7e0ddc2
2 changed files with 2 additions and 1 deletions

View File

@ -32,7 +32,7 @@ function dependencyStream(
extensions: []
.concat(config.requireExtension || [])
.map(ext => '.' + ext.replace(/^\./, ''))
.concat(['.js', '.json', '.es6', '.jsx']),
.concat(['.mjs', '.js', '.json', '.es6', '.jsx']),
transform: [
babelify.configure({
sourceMap: false,

View File

@ -84,6 +84,7 @@ function mergeConfigFile(config): Promise<Object> {
function mergeConfig(config: Object): Promise<DocumentationConfig> {
config.parseExtension = (config.parseExtension || []).concat([
'mjs',
'js',
'jsx',
'es5',