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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy