From c6e0167372a286d33540de120b653bf797363fde Mon Sep 17 00:00:00 2001
From: "Michael \"Z\" Goddard" <mzgoddard@gmail.com>
Date: Mon, 30 Apr 2018 18:24:56 -0400
Subject: [PATCH] chore(webpack): configure babel loader to build scratch deps

Configure loaders so they operate on individual modules in scratch-*
dependencies.
---
 webpack.config.js | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/webpack.config.js b/webpack.config.js
index 68c87a3ae..fad2ba4bc 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -32,7 +32,20 @@ const base = {
         rules: [{
             test: /\.jsx?$/,
             loader: 'babel-loader',
-            include: path.resolve(__dirname, 'src')
+            include: [path.resolve(__dirname, 'src'), /node_modules[\\/]scratch-[^\\/]+[\\/]src/],
+            options: {
+                // Explicitly disable babelrc so we don't catch various config
+                // in much lower dependencies.
+                babelrc: false,
+                plugins: [
+                    'syntax-dynamic-import',
+                    'transform-async-to-generator',
+                    'transform-object-rest-spread',
+                    ['react-intl', {
+                        messagesDir: './translations/messages/'
+                    }]],
+                presets: [['env', {targets: {browsers: ['last 3 versions', 'Safari >= 8', 'iOS >= 8']}}], 'react']
+            }
         },
         {
             test: /\.css$/,
-- 
GitLab