From a671926fa8086e52d1ff15c836e8ffc5053cf2bd Mon Sep 17 00:00:00 2001 From: Wouter de Vos Date: Fri, 21 Sep 2018 21:58:45 +0200 Subject: [PATCH] Fix issue with .mjs files See: https://github.com/graphql/graphql-js/issues/1272\#issuecomment-393903706 --- src/webpack/common.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/webpack/common.ts b/src/webpack/common.ts index 650dc92..f2b4651 100644 --- a/src/webpack/common.ts +++ b/src/webpack/common.ts @@ -87,6 +87,11 @@ export default (_ssr: boolean /* <-- not currently used */) => { }, ], }, + { + include: /node_modules/, + test: /\.mjs$/, + type: "javascript/auto", + }, ], }, @@ -98,7 +103,7 @@ export default (_ssr: boolean /* <-- not currently used */) => { alias: { "@": path.resolve(root, "src"), }, - extensions: [".ts", ".tsx", ".js"], + extensions: [".ts", ".tsx", ".webpack.js", ".web.js", ".mjs", ".js"], modules: [ path.resolve(root, "node_modules"), ],