title: Why is my ES6 having different exports (exports || exports.default + named) depending on the scope of the import?
body: <p>I have this in a yargs script:</p>
  
  <pre class="lang-js prettyprint-override"><code>  const pkg = require(join(argv.path, 'package.json'));
    const exported = require(join(argv.path, pkg.main));
    console.log(exported);
  </code></pre>
  
  <p>If i try to read this source within the yargs script package <code>pkg.main</code>:</p>
  
  <pre class="lang-js prettyprint-override"><code>import SiteService, { SiteFunction } from 'site-service';
  
  export const siteService = new SiteService('management', {
    id: 1000,
    othersIds: 1000,
  });
  
  export const siteFunction = new SiteFunction(siteService, {
    id: 1000,
    othersIds: 1000,
  });
  
  export default siteService;
  </code></pre>
  
  <p>The the value of exported is : </p>
  
  <pre class="lang-js prettyprint-override"><code>{ siteService:
     SiteService {
       name: 'management',
       config: { id: 1000, othersIds: 1000 },
       siteFunctionList: [] },
    siteFunction:
     SiteFunction {
       siteService:
        SiteService {
          name: 'management',
          config: [Object],
          siteFunctionList: [] },
       config: { id: 1000, othersIds: 1000 } },
    default:
     SiteService {
       name: 'management',
       config: { id: 1000, othersIds: 1000 },
       siteFunctionList: [] } }
  </code></pre>
  
  <p>If i read the <code>pkg.main</code> of a different module with this content:</p>
  
  <pre class="lang-js prettyprint-override"><code>import React from 'react';
  import Resource from 'ra-core/lib/Resource';
  import Route from 'react-router-dom/Route';
  import SiteService, { SiteFunction } from 'site-service';
  const siteService = new SiteService('management', {
    id: 1000,
    otherIds: [1, 2],
  });
  
  import {
    UsersList,
    UsersCreate,
    UsersEdit,
    UsersShow,
  } from './resources/users';
  
  export const siteFunction = new SiteFunction(siteService, ({ pages, roles, permissions }) =&gt; [
    &lt;Resource
      name="users"
      list={UsersList}
      edit={UsersEdit}
      create={UsersCreate}
      show={UsersShow}
    /&gt;,
  ], ({ pages, roles }) =&gt; [
  ], ({ pages, roles }) =&gt; [
    {
      name: 'management',
      redirect: true,
      from: '/management',
      to: '/',
      description: 'management',
    },
  ]);
  
  
  export default siteFunction;
  </code></pre>
  
  <p>I have the following output</p>
  
  <pre class="lang-js prettyprint-override"><code>SiteFunction {
    siteService:
     SiteService {
       name: 'management',
       config: { id: 1000, otherIds: [Array] },
       siteFunctionList: [] },
    config: [Function] }
  </code></pre>
  
  <p>Both project babel configuration in <code>babel.config.js</code>:</p>
  
  <pre><code>{
    only: [
      'src',
      'styleguide',
    ],
    comments: false,
    presets: [
      [
        '@babel/preset-env',
        {
          modules: false,
        },
      ],
      '@babel/preset-react',
    ],
    plugins: [
      'babel-plugin-array-includes',
      '@babel/plugin-transform-runtime',
      '@babel/plugin-transform-async-to-generator',
      '@babel/plugin-proposal-class-properties',
      '@babel/plugin-syntax-dynamic-import',
      '@babel/plugin-syntax-import-meta',
      '@babel/plugin-proposal-json-strings',
      [
        '@babel/plugin-proposal-decorators',
        {
          legacy: true,
        },
      ],
    ],
    env: {
      production: {
        plugins: [
          'babel-plugin-add-module-exports',
          '@babel/plugin-transform-modules-commonjs',
        ],
      },
      test: {
        plugins: [
          '@babel/plugin-transform-modules-commonjs',
          'babel-plugin-dynamic-import-node',
        ],
      },
    },
  }
  </code></pre>
  
  <p><strong>In both case, the <code>pkg.main</code> imported was in ES6 syntax</strong>, while the <code>yargs</code> script run was a ES5 transpiled file.</p>
  
  <ol>
  <li>I believe this is not good, am I correct?</li>
  <li>Where does the bug happen? Both projects have the same babel configuration.</li>
  <li>Within my script, should I assume both cases can happen and should I support both?</li>
  </ol>