Skip to content

Commit b8a7e0d

Browse files
jaydenserictmcw
authored andcommitted
feat: Support the .mjs extension by default. (#1023)
Fixes #1022. `.mjs` is ordered before `.js` as that is the resolution order in other tools such as Webpack v4.
1 parent 487336f commit b8a7e0d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/input/dependency.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function dependencyStream(
3232
extensions: []
3333
.concat(config.requireExtension || [])
3434
.map(ext => '.' + ext.replace(/^\./, ''))
35-
.concat(['.js', '.json', '.es6', '.jsx']),
35+
.concat(['.mjs', '.js', '.json', '.es6', '.jsx']),
3636
transform: [
3737
babelify.configure({
3838
sourceMap: false,

src/merge_config.js

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ function mergeConfigFile(config): Promise<Object> {
8484

8585
function mergeConfig(config: Object): Promise<DocumentationConfig> {
8686
config.parseExtension = (config.parseExtension || []).concat([
87+
'mjs',
8788
'js',
8889
'jsx',
8990
'es5',

0 commit comments

Comments
 (0)