0

I'm working on a two-part typescript, sass + react css modules project consisting of a library module and a consumer project, and I've just moved from webpack to fuse-box for bundling (so much easier and faster to work with!)

In the documentation for Fusebox (https://fuse-box.org/page/publishing-to-npm), they recommend publishing raw typescript for the library, so that tree-shaking will work better which is something that I want to do, as I'm using dependency injection with inversify, so when I create more consumer projects I won't always use everything from the library.

Following the guide to get this working is fine, but I'm not sure what to do with the scss files which are react css modules from the library project.

Should the scss files also be published raw so that the consumer can compile them in one go, or should they be compiled for publishing?

adamfsk
  • 357
  • 1
  • 9
  • Absolutely! You should publish the source as is with raw sass files. That will ensure the consistency of your build. – user3677173 Jul 11 '18 at 13:42
  • Moreover, you could require your modules explicitely from the package. `import {A} from "package/src/a"`. I would recommend, however, moving src to the root when publishing to npm. – user3677173 Jul 11 '18 at 13:43

0 Answers0