title: How to get minified files in project ( Gatsby / React )
body: <p>gatsby version = 2.0.0-beta.19</p>
  
  <p>node version = v10.6.0</p>
  
  <p>npm version = 6.1.0</p>
  
  <p>VScode version = 1.25.1</p>
  
  <p>When adding minified files (.min.js or .js with minified content) to my react Gatsby project, I get the following error when I try to do <code>gatsby develop</code>:</p>
  
  <pre>
   ERROR  Failed to compile with 1 errors                                                                                                                      10:41:47 AM
   error  in ./src/components/appinsights.js
  
  Module Error (from ./node_modules/eslint-loader/index.js):
  
  /mnt/d/my_site/src/components/appinsights.js
    2:185  error    Expected an assignment or function call and instead saw an expression  no-unused-expressions
    2:248  warning  Unexpected use of comma operator                                       no-sequences
    2:493  warning  Unexpected use of comma operator                                       no-sequences
    2:649  error    Expected an assignment or function call and instead saw an expression  no-unused-expressions
    2:660  warning  Unexpected use of comma operator                                       no-sequences
    2:761  warning  Unexpected use of comma operator                                       no-sequences
    7:1    error    Expected an assignment or function call and instead saw an expression  no-unused-expressions
    7:31   warning  Unexpected use of comma operator                                       no-sequences
  
  ✖ 8 problems (3 errors, 5 warnings)
  </pre>
  
  <p>I added a new file "./src/components/appinsights.js" and the contents of the file are from inside the script tag of <a href="https://github.com/Microsoft/ApplicationInsights-JS" rel="nofollow noreferrer">App insights JS snippet</a></p>
  
  <pre><code>var appInsights=window.appInsights||function(a){
      function b(a){c[a]=function(){var b=arguments;c.queue.push(function(){c[a].apply(c,b)})}}var c={config:a},d=document,e=window;setTimeout(function(){var b=d.createElement("script");b.src=a.url||"https://az416426.vo.msecnd.net/scripts/a/ai.0.js",d.getElementsByTagName("script")[0].parentNode.appendChild(b)});try{c.cookie=d.cookie}catch(a){}c.queue=[];for(var f=["Event","Exception","Metric","PageView","Trace","Dependency"];f.length;)b("track"+f.pop());if(b("setAuthenticatedUserContext"),b("clearAuthenticatedUserContext"),b("startTrackEvent"),b("stopTrackEvent"),b("startTrackPage"),b("stopTrackPage"),b("flush"),!a.disableExceptionTracking){f="onerror",b("_"+f);var g=e[f];e[f]=function(a,b,d,e,h){var i=g&amp;&amp;g(a,b,d,e,h);return!0!==i&amp;&amp;c["_"+f](a,b,d,e,h),i}}return c
  }({
      instrumentationKey: "&lt;my_key&gt;"
  });
  
  window.appInsights=appInsights,appInsights.queue&amp;&amp;0===appInsights.queue.length&amp;&amp;appInsights.trackPageView();
  </code></pre>
  
  <p>In my "./src/components/layout.js" </p>
  
  <pre><code>import appinsightsFile from './appinsights.js'
  ...
  &lt;Helmet
      title={data.site.siteMetadata.title}&gt;
      &lt;html lang="en" /&gt;
      &lt;script type="application/ld+json"&gt;{appinsightsFile}&lt;/script&gt;
  &lt;/Helmet&gt;
  ...
  </code></pre>
  
  <p>I am not sure if this is a react issue or Gatsby. I can't seem to get any minified code to work with my application.</p>
  
  <p>I have tried:</p>
  
  <ul>
  <li>inline app insights code in my layout.js   </li>
  <li>taking the script tags out of the helmet code </li>
  </ul>