title: Conditional Import based on environment variable
body: <p>I have a react component which has X options for a stylesheet to be imported which is using CSS Modules.</p>
  
  <p>I ideally want to have a global environment variable fetched by using e.g.</p>
  
  <p>process.env.THEME</p>
  
  <p>I can't use:</p>
  
  <pre><code>import MyStyleSheet from `${process.env.THEME}/my.module.css`
  </code></pre>
  
  <p>I can use:</p>
  
  <pre><code>const MyStyleSheet = require(process.env.THEME/my.module.css);
  </code></pre>
  
  <p>however.....</p>
  
  <p><code>import/no-dynamic-require</code> eslint rule kicks off saying its bad. 
  <a href="https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-dynamic-require.md" rel="noreferrer">https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-dynamic-require.md</a></p>
  
  <p>All the articles and posts I read say its not possible. 
  Surely this is a common want but I can't for the life of me work out how to do it. Any ideas?</p>
  
  <hr>
  
  <p>Update:</p>
  
  <pre><code>import React from 'react';
  
  const Classes = import('./${process.env.theme}/Button.module.css');
  
  const Button = () =&gt; (
    &lt;button className={Classes.button}&gt;My Themed Button&lt;/button&gt;
  );
  
  export default Button;
  </code></pre>