I am working on a few projects which depend on a common React library.
We use tsc to compile common and use it like so in the other projects:
// package.json
"dependencies": {
...
"common": "file:../common",
...
}
// RandomComponent.tsx
import Alert from 'common/dist/components/Alert';
Recently we introduced sass as a dependency of the common library to style our components. Since tsc can't handle sass compilation, we introduced webpack to compile the typescript and sass.
But, now the dist output folder no longer contains the compiled .js components (which makes sense because everything is included in the bundle instead). I can't seem to determine a way to use the bundle in the other projects.
How can we use Webpack in the common library and use the output in other projects?