Next.js Discord

Discord Forum

publish next project as a npm package

Unanswered
AM posted this in #help-forum
Open in Discord
AMOP
hello do you have any tutorial on how to i've tried many diff config/setups and stuff but none of them seems working currently using tsup to prepare a dist folder but hitting

Error: error occured in dts build
    at Worker.<anonymous> (/Users/andonmitev/Desktop/doctor-templates/node_modules/tsup/dist/index.js:2693:26)
    at Worker.emit (node:events:518:28)
    at MessagePort.<anonymous> (node:internal/worker:263:53)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:826:20)
    at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)
DTS Build error
RollupError: [plugin dts] app/index.ts: Failed to compile. Check the logs above.


i've followed many diff advices but nothing help if you have something working i would love to see it

11 Replies

Just follow the directions in the readme
@linesofcode https://github.com/TimMikeladze/tsup-react-package-starter
AMOP
ahh thank you dude, i just manage to release and install it successfully but then tailwind/css styles are gone i see you have section about this in your repo will take a look
once again thank you so much!
no problem, good luck!
@linesofcode no problem, good luck!
AMOP
just 1 quick question, do i need to download the boilerplate and work there i already have some codebase that i want to use also is this working with shadcn and tailwind? sorry for questioning just want to understand which entry point to use
Lines 27 through 33 are the important ones in package.json
if you have a tsup config and some package.json config thats all you really need
@linesofcode if you have a tsup config and some package.json config thats all you really need
AMOP
thank you so much dude looks amazing, just any idea why is ignoring styles from tailwind when package is installed into new project, this is my package.json

[package.json](https://pastebin.com/eARiMHyJ)

[tsup-config](https://pastebin.com/G9LGhNP1)

i've manage to release it successfully:

https://www.npmjs.com/package/doctor-templates

but then styles are not recognized in imported components