Compiled Packages and package.json#imports

Hi guys, we’re having problems understanding and make it work having a Compiled Package with assets work with tsc or a build tool like tsup or rslib.

We’re following the Turborepo docs

For example, if we try to build our Compiled Package with tsc, this won’t process the .sass files, and etc, what’s the recommended step here? Running sass or postcss in a second step?

And if we want to use a build tool like tsup or rslib those fail to process package.json#import pointing to dist, because don´t find the modules. How can we fix it?

What are the recommendations about this? Any hidden guide or something?

tsc only compiles TypeScript, as you’ve noticed. We recommend using a bundler if your requirements are more than a simply transpile from TypeScript to JavaScript.

We tend to recommend bunchee, but you’re, of course, free to use the bundler of your choice. If you’re having issues with the bundler you choose, you’ll want to request help with it in that bundler’s community.

1 Like