From ab6c56bf059c17f4fc0530e4098bd16e79e1be54 Mon Sep 17 00:00:00 2001
From: Nathan L Smith <smith@nlsmith.com>
Date: Tue, 21 Apr 2020 15:04:51 -0500
Subject: [PATCH] [kbn-storybook] Use raw loader for text files

Starting Storybook (with `yarn storybook apm`) was failing to start because it was having trouble loading Angular .html templates.

Use the raw loader in the webpack config for storybook, same as the Webpack config in kbn-optimizer.
---
 packages/kbn-storybook/storybook_config/webpack.config.js | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/packages/kbn-storybook/storybook_config/webpack.config.js b/packages/kbn-storybook/storybook_config/webpack.config.js
index 1531c1d22b01b..779d8a4153644 100644
--- a/packages/kbn-storybook/storybook_config/webpack.config.js
+++ b/packages/kbn-storybook/storybook_config/webpack.config.js
@@ -49,6 +49,13 @@ module.exports = async ({ config }) => {
     },
   });
 
+  config.module.rules.push({
+    test: /\.(html|md|txt|tmpl)$/,
+    use: {
+      loader: 'raw-loader',
+    },
+  });
+
   // Handle Typescript files
   config.module.rules.push({
     test: /\.tsx?$/,