title: Build package with CSS modules for Next.js
body: <p>Building a package with UI components using CSS modules. Each component is totally separated from others and includes CSS styles like this:</p>
  <pre class="lang-js prettyprint-override"><code>import css from './styles.css'
  
  const Component = () =&gt; {
    return (
      &lt;div className={css.container}&gt;Hello there!&lt;/div&gt;
    )
  }
  
  export { SearchBar }
  </code></pre>
  <p>In another package based on Next.js I want import a component like this:</p>
  <pre><code>import { Component } from '@me/components'
  </code></pre>
  <p>But Next.js doesn't allow Module CSS import from node_modules.</p>
  <p>My question is how can I build the component package with CSS transformed into JS. It shouldn't be merged into one file just like Webpack do. Instead it should build each component separately. Also I don't want to import a huge CSS files with all styles merged into single file. Easiest way would be to use CSS-in-JS, but I want to use PostCSS written in CSS files.</p>