Skip to content

Commit

Permalink
feat(app): out of the box support for .mjs files #6689
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoenescu committed Mar 30, 2020
1 parent 9c7e10e commit 6559a04
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/lib/webpack/create-chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports = function (cfg, configName) {
chain.resolve.symlinks(false)

chain.resolve.extensions
.merge([ '.js', '.vue', '.json' ])
.merge([ '.mjs', '.js', '.vue', '.json' ])

chain.resolve.modules
.merge(resolveModules)
Expand Down Expand Up @@ -214,6 +214,14 @@ module.exports = function (cfg, configName) {
lessLoaderOptions: cfg.build.lessLoaderOptions
})

chain.module // fixes https://github.com/graphql/graphql-js/issues/1272
.rule('mjs')
.test(/\.mjs$/)
.include
.add(/node_modules/)
.end()
.type('javascript/auto')

chain.plugin('vue-loader')
.use(VueLoaderPlugin)

Expand Down

4 comments on commit 6559a04

@J3m5
Copy link

@J3m5 J3m5 commented on 6559a04 Mar 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
is it related to the modern build feature?

@rstoenescu
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, it's related exactly to graphql/graphql-js#1272

@J3m5
Copy link

@J3m5 J3m5 commented on 6559a04 Mar 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your reply,
is the modern build feature still on the roadmap?

@rstoenescu
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, of course.

Please sign in to comment.