title: Getting error when i am trying to use constant when importing in React.JS
body: <p>I am working on react, when i am trying to use <code>const</code> <code>app_url</code> i am getting error, in this line i am getting error <code>import MobileEsp from app_url+'/js/mdetect.js';</code> it is because of app_url, here is my full code of it, can anyone please help me to resolve this issue ?</p>
  
  <p>Error : </p>
  
  <pre><code>Module build failed (from ./node_modules/babel-loader/lib/index.js):
  SyntaxError: /var/www/minimal-react-webpack-babel-setup/src/App.js: Unexpected token (6:22)
  </code></pre>
  
  <p>Code </p>
  
  <pre><code>import React from 'react';
  
  const app_url = 'https://*******.com/';
  
  import $ from "jquery";
  import MobileEsp from app_url+'/js/mdetect.js'; 
  
  //const App = ({ title }) =&gt;
  
  class App extends React.Component {
  
    componentDidMount() {
      if (!MobileEsp.DetectTierIphone() &amp;&amp; !MobileEsp.DetectTierTablet()) {
  
        var LinkDownloadAppMac1 = "*****";
        var LinkDownloadAppWin1 = "******";
        switch (navigator.platform) {
          case 'MacIntel':
            $('#menu-download-link').attr('href', LinkDownloadAppMac1);
            break;
          default:
            $('#menu-download-link').attr('href', LinkDownloadAppWin1);
            break;
  
        }
      }
  }
  </code></pre>