Skip to content

Commit

Permalink
feat: Support the .mjs extension by default. (#1023)
Browse files Browse the repository at this point in the history
Fixes #1022.

`.mjs` is ordered before `.js` as that is the resolution order in other tools such as Webpack v4.
  • Loading branch information
jaydenseric authored and tmcw committed Mar 1, 2018
1 parent 487336f commit b8a7e0d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/input/dependency.js
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/merge_config.js
Expand Up @@ -84,6 +84,7 @@ function mergeConfigFile(config): Promise<Object> {

function mergeConfig(config: Object): Promise<DocumentationConfig> {
config.parseExtension = (config.parseExtension || []).concat([
'mjs',
'js',
'jsx',
'es5',
Expand Down

0 comments on commit b8a7e0d

Please sign in to comment.