title: Using Javascript ES6 import and export functionality in Codepen projects
body: <p>I am trying to use the Javascript ES6 import/export functionality in my <a href="https://codepen.io/spw1016/project/editor/AmyLwb" rel="noreferrer">Codepen project</a>, and I thought it was supported based on some <a href="https://blog.codepen.io/projects/using-babel-codepen-project/" rel="noreferrer">articles</a> I read, but I am having trouble getting it to work. I have set my Codepen project to use Webpack and Babel to process my javascript file, and even tried using Chrome Canary to see if that would support ES6 (to no avail).</p>
  
  <p>In my Codepen project, I wrote a basic example exporting a string variable from one file:</p>
  
  <pre><code>//data.js
  export let firstName = 'George';
  </code></pre>
  
  <p>Then importing it into my primary javascript file to log in the console:</p>
  
  <pre><code>//index.js
  import firstName from "./data";
  console.log(FirstName);
  </code></pre>
  
  <p>Unfortunately, the Chrome console is reporting the error:</p>
  
  <pre><code>Uncaught VM3034 index.js:1
  SyntaxError: Unexpected token import
  </code></pre>
  
  <p>Does anyone know how to get this to work, if possible? I even found another example of a <a href="https://codepen.io/maximebj/project/editor/DvzOBD" rel="noreferrer">Codepen project using ES6 import/export successfully</a>, but I'm not sure what I'm doing differently to get the error. Any help would be much appreciated.</p>