File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -187,6 +187,16 @@ module.exports = {
187187 ] ,
188188 include : paths . appSrc ,
189189 } ,
190+ {
191+ // `mjs` support is still in its infancy in the ecosystem, so we don't
192+ // support it.
193+ // Modules who define their `browser` or `module` key as `mjs` force
194+ // the use of this extension, so we need to tell webpack to fall back
195+ // to auto mode (ES Module interop, allows ESM to import CommonJS).
196+ test : / \. m j s $ / ,
197+ include : / n o d e _ m o d u l e s / ,
198+ type : 'javascript/auto' ,
199+ } ,
190200 {
191201 // "oneOf" will traverse all following loaders until one will
192202 // match the requirements. When no loader matches it will fall
Original file line number Diff line number Diff line change @@ -244,6 +244,16 @@ module.exports = {
244244 ] ,
245245 include : paths . appSrc ,
246246 } ,
247+ {
248+ // `mjs` support is still in its infancy in the ecosystem, so we don't
249+ // support it.
250+ // Modules who define their `browser` or `module` key as `mjs` force
251+ // the use of this extension, so we need to tell webpack to fall back
252+ // to auto mode (ES Module interop, allows ESM to import CommonJS).
253+ test : / \. m j s $ / ,
254+ include : / n o d e _ m o d u l e s / ,
255+ type : 'javascript/auto' ,
256+ } ,
247257 {
248258 // "oneOf" will traverse all following loaders until one will
249259 // match the requirements. When no loader matches it will fall
You can’t perform that action at this time.
0 commit comments