how to export and import style in npm package? : <p>I have a react component and I publish the component in NPM registry that I build with webpack. In my main project I consumed the component npm package JS like that:</p>

<pre><code>Import myComp from 'myComp';
</code></pre>

<p>The problem is that myComp also have CSS, that I build into <code>dist/index.css</code> with the help of webpack and ExtractTextPlugin (which build all the css into one file).</p>

<p>And I want to consume the style like this:</p>

<pre><code>Import 'myComp/index.css';
</code></pre>

<p>Or</p>

<pre><code>Import 'myComp/index';
</code></pre>

<p>And in myComp npm package I want to expose it in a way that will support this import method.</p>

<p>NOTE: i don't want to import it directly from <code>node_modules</code></p>

<pre><code>Import '../../../node_modules/myComp/index.css'; // bad
</code></pre>

<p>Thanks!</p>
