## the problem

nextjs can:
- import global `*.(s)css` in _app.js
- import global `*.(s)css` in a component, _if_ it's from `node_modules`
- import local `*.module.(s)css` in a component

## alternatives

### transpiling the library code

idea:
- you whitelist certain packages to be transpiled, e.g. `@rasahq/*`
- nextjs will transpile those in context

questions:
- is there an equivalent for gatsby
- is there an equivalent for docusaurus

[next-transpile-modules](https://github.com/martpie/next-transpile-modules#readme)
[next.js/examples/with-yarn-workspaces](https://github.com/vercel/next.js/tree/canary/examples/with-yarn-workspaces)
[next.js/css-global.md at master · vercel/next.js](https://github.com/vercel/next.js/blob/master/errors/css-global.md)

### compiling the library with styles, so imports are flat JS and CSS

- if including styles, babel won't be enough
- rollup seems to have the most options here:
	- can configure output for different consumption patterns
	- can preserve the module structure
- problem remains that only "simple" sass can be used here
	- must be ignorant of tabula config and helpers
	- but *could* probably use `*.module.scss` format if desired

references

- [rollup.js](https://rollupjs.org/guide/en/#tree-shaking)
- [How to propperly build react modular library - Stack Overflow](https://stackoverflow.com/questions/64845179/how-to-propperly-build-react-modular-library/64947770#64947770)
