title: Github CD Pipelines crashes on production build with ES modules as config
body: <p>I'm trying to deploy my github pages using CD. </p>
  
  <p>My CI seems to properly work with es modules as my webpack config(<a href="https://github.com/crrmacarse/crrmacarse.github.io/actions/runs/31859113" rel="nofollow noreferrer">https://github.com/crrmacarse/crrmacarse.github.io/actions/runs/31859113</a>) but when i try to do it on CD it crashes with this error:</p>
  
  <p><a href="https://i.stack.imgur.com/j5zIM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j5zIM.png" alt="enter image description here"></a></p>
  
  <p>Here is my yml config:</p>
  
  <pre><code>name: Release
  
  on:
    push:
      branches:
        - source
  
  env:
    NODE_ENV: production
    PUBLIC_URL: http://crrmacarse.github.io/
    GA_TRACKING_CODE: ${{ secrets.GA_TRACKING_CODE }}
    FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
  
  jobs:
    publish:
      runs-on: ubuntu-latest
      steps:
      - uses: actions/checkout@v2.0.0
  
      - name: Use node 12
        uses: actions/setup-node@v1
        with:
            node-version: 12
            registry-url: https://registry.npmjs.org
  
      - name: install
        run: npm install
      - name: build
        run: npm run prod
      # https://babeljs.io/docs/en/next/babel-node.html#not-meant-for-production-use
      # - name: build sitemap
      #   run: npm run sitemap
      - name: copy
        run: npm run copy
  
      - name: Build and Deploy
        uses: JamesIves/github-pages-deploy-action@releases/v3
        with:
          ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
          BRANCH: master
          FOLDER: dist
  </code></pre>
  
  <p>Iirc, I used babel-preset to achieve this ES module exports. Where did it went wrong?</p>
  
  <p>Here is the code in question</p>
  
  <pre><code>// eslint-disable-next-line import/no-dynamic-require, global-require
  export default (env) =&gt; require(`./compiler/${env}.js`);
  </code></pre>
  
  <p><a href="https://github.com/crrmacarse/crrmacarse.github.io/blob/source/webpack.config.babel.js" rel="nofollow noreferrer">https://github.com/crrmacarse/crrmacarse.github.io/blob/source/webpack.config.babel.js</a></p>