From 13d09656c5a7d9d25c8b252605a5f2e2904f6033 Mon Sep 17 00:00:00 2001 From: Agostino Marzotta Date: Wed, 21 Oct 2020 17:28:49 +0200 Subject: [PATCH] fix(build): fixed failed import of .mjs --- config/webpack.config.dev.js | 5 +++-- config/webpack.config.prod.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index 47bf3573..7363f517 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -80,7 +80,7 @@ module.exports = { }, resolve: { modules: ['node_modules'], - extensions: ['.js', '.elm'], + extensions: ['.js', '.mjs', '.elm'], }, module: { strictExportPresence: true, @@ -93,7 +93,7 @@ module.exports = { exclude: [/[/\\\\]elm-stuff[/\\\\]/, /[/\\\\]node_modules[/\\\\]/], include: paths.appSrc, loader: require.resolve('babel-loader'), - query: { + options: { presets: [ [ require.resolve('@babel/preset-env'), @@ -227,6 +227,7 @@ module.exports = { exclude: [ /\.html$/, /\.js$/, + /\.mjs$/, /\.elm$/, /\.css$/, /\.scss$/, diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 25f68811..63895138 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -139,7 +139,7 @@ module.exports = { }, resolve: { modules: ['node_modules'], - extensions: ['.js', '.elm'], + extensions: ['.js', '.mjs', '.elm'], }, module: { strictExportPresence: true, @@ -149,7 +149,7 @@ module.exports = { test: /\.js$/, exclude: [/[/\\\\]elm-stuff[/\\\\]/, /[/\\\\]node_modules[/\\\\]/], loader: require.resolve('babel-loader'), - query: { + options: { // Latest stable ECMAScript features presets: [ [ @@ -278,6 +278,7 @@ module.exports = { exclude: [ /\.html$/, /\.js$/, + /\.mjs$/, /\.elm$/, /\.css$/, /\.scss$/,