title: How to resolve rollup build error when using emotion: 'default' is not exported by @emotion\memoize\dist\memoize.cjs.js
body: <p>I'm trying to build a standardized react button component for our enterprise library. I want to be able to use @emotion/styled to generate the styled react component. We are using rollup as our package builder, which is transpiling from typescript to esm and commonjs. When I run the build, I'm getting the following error:
  <code>Error: 'default' is not exported by node_modules\@emotion\memoize\dist\memoize.cjs.js
  node_modules\@emotion\is-prop-valid\dist\is-prop-valid.esm.js (1:7)
  1: import memoize from '@emotion/memoize';</code></p>
  
  <p>I'm still learning the ins and outs of building with rollup and typescript, so I can't tell if I'm just doing something wrong, or if there's an actual issue with the @emotion libraries. </p>
  
  <p>I've tried setting :</p>
  
  <pre><code>commonjs({
      include: ['/node_modules/**', '../../../node_modules/**'],
      namedExports: {
          'node_modules/@emotion/memoize/dist/memoize.cjs.js': ['memoize']
      }
  })
  </code></pre>
  
  <p>and </p>
  
  <pre><code>commonjs({
      include: ['/node_modules/**', '../../../node_modules/**'],
      namedExports: {
          'node_modules/@emotion/memoize/dist/memoize.cjs.js': ['default']
      }
  })
  </code></pre>
  
  <p>But neither work.
  I've tried installing different versions of @emotions, from 10.0.0 to 10.0.10, and it happens with all versions.
  I've also tried installing @emotion/memoize directly, but it also didn't work.</p>
  
  <p>Here are my build settings and code:</p>
  
  <p>custom-button.tsx</p>
  
  <pre class="lang-js prettyprint-override"><code>import React from 'react';
  import CustomButtonProps from './custom-button-props';
  import styled, { StyledComponent } from '@emotion/styled';
  import { StyleConstants } from '@enterprise-api/constants';
  
  export class CustomButton extends React.PureComponent&lt;CustomButtonProps&gt; {
      public constructor(props: CustomButtonProps) {
          super(props);
      }
  
      private DefaultButton: StyledComponent&lt;any, any, any&gt; = styled.button`
          height: 2rem;
          padding-left: 0.75rem;
          padding-right: 0.75rem;
          ${StyleConstants.defaultButton}
      `;
  
      public render(): React.ReactNode {
          if (this.props.style) {
              return (
                  &lt;button style={this.props.style} onClick={this.props.onClick}&gt;
                      {this.props.text}
                  &lt;/button&gt;
              );
          }
          return &lt;this.DefaultButton onClick={this.props.onClick}&gt;{this.props.text}&lt;/this.DefaultButton&gt;;
      }
  }
  
  export default CustomButton;
  </code></pre>
  
  <p>custom-button-props.tsx</p>
  
  <pre class="lang-js prettyprint-override"><code>import { MouseEvent, KeyboardEvent, CSSProperties } from 'react';
  
  export interface CustomButtonProps {
      text: string;
      onClick: (event: MouseEvent | KeyboardEvent) =&gt; void;
      style?: CSSProperties;
  }
  
  export default CustomButtonProps;
  </code></pre>
  
  <p>rollup.config.js</p>
  
  <pre><code>import typescript from 'rollup-plugin-typescript2';
  import pkg from './package.json';
  import resolve from 'rollup-plugin-node-resolve';
  import commonjs from 'rollup-plugin-commonjs';
  
  export default {
      input: 'src/index.ts',
      output: [
          {
              file: pkg.main,
              format: 'cjs',
              exports: 'named'
          },
          {
              file: pkg.module,
              format: 'es',
              compact: true
          }
      ],
      external: [...Object.keys(pkg.peerDependencies || {})],
  
      plugins: [
          typescript({
              typescript: require('typescript')
          }),
          resolve(),
          commonjs({
              include: ['/node_modules/**', '../../../node_modules/**']
          })
      ]
  };
  </code></pre>
  
  <p>tsconfig.json</p>
  
  <pre><code>{
      "compilerOptions": {
          "outDir": "./lib/", // path to output directory
          "sourceMap": false, // allow sourcemap support
          "strictNullChecks": true, // enable strict null checks as a best practice
          "module": "es6", // specify module code generation
          "jsx": "react", // use typescript to transpile jsx to js
          "target": "es5", // specify ECMAScript target version
          "allowJs": false, // allow a partial TypeScript and JavaScript codebase
          "strict": true,
          "declaration": true,
          "moduleResolution": "node",
          "esModuleInterop": true,
          "noImplicitAny": true,
          "noImplicitReturns": true,
          "noImplicitThis": true
      },
      "include": ["src"],
      "exclude": ["node_modules", "**/__tests__/*"]
  }
  </code></pre>
  
  <p>package.json</p>
  
  <pre><code>{
      "name": "@custom-component/button",
      "version": "0.0.0",
      "description": "",
      "main": "lib/index.js",
      "types": "lib/index.d.ts",
      "module": "lib/index.esm.js",
      "scripts": {
          "test": "jest --config jestconfig.json --coverage",
          "document": "typedoc --out documentation --hideGenerator --includeDeclarations --exclude \"**/node_modules/**\" src/",
          "compile": "rollup -c",
          "audit": "yarn audit --registry=https://registry.npmjs.org --json &gt; audit-results.json",
          "build": "yarn run clean &amp;&amp; yarn run document &amp;&amp; yarn run compile",
          "clean": "shx rm -rf lib documentation",
          "prepublishOnly": "yarn run build &amp;&amp; yarn version --patch"
      },
      "files": [
          "lib/**/*"
      ],
      "author": "",
      "license": "ISC",
      "devDependencies": {
          "@emotion/core": "^10.0.0",
          "@emotion/styled": "^10.0.0",
          "@types/jest": "^24.0.3",
          "@types/react": "^16.8.8",
          "@typescript-eslint/eslint-plugin": "^1.1.0",
          "@typescript-eslint/parser": "^1.1.0",
          "awesome-typescript-loader": "^5.2.1",
          "eslint": "^5.12.0",
          "jest": "^24.5.0",
          "react": "^16.8.5",
          "rollup": "^1.7.2",
          "rollup-plugin-commonjs": "^9.2.0",
          "rollup-plugin-node-resolve": "^4.0.0",
          "rollup-plugin-typescript2": "^0.20.1",
          "shx": "^0.3.2",
          "ts-jest": "^24.0.0",
          "typedoc": "^0.14.2",
          "typescript": "^3.2.4"
      },
      "peerDependencies": {
          "@types/react": "^16.8.8",
          "react": "^16.8.5"
      },
      "dependencies": {
          "@emotion/core": "^10.0.0",
          "@emotion/styled": "^10.0.0",
          "@enterprise-api/constants": "^0.0.8-beta"
      }
  }
  </code></pre>
  
  <p>I should be able to build this component without any issue, but instead I get the error above.</p>
  
  <p>Thanks!</p>