-
-
Notifications
You must be signed in to change notification settings - Fork 755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace rollup by tsup as building tool #2631
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thank you @g1mishra for this first contribution! |
Note that we should use https://nextjs.org/docs/app/api-reference/next-config-js/transpilePackages for the 4th spec |
@zbeyens, could you please explain how to make use of transpilePackages here? Additionally, I'm interested in understanding any areas where I may have made mistakes in my current approach. |
@g1mishra See https://github.com/itsjavi/turborepo-react-next as a reference. |
updates :
It's working but it's watching for all the packages, so my device getting freezed So to deal with the issue of watching all the packages, I have added I'm not able to think of other ways of doing it. |
Thanks for the update. I see the ref repo is using |
Wish that you told me that haha |
What's being done here is exactly what I did. |
Emotion: Saying respectfully! |
No worries, the main focus should be on completing all the specifications required. |
const { dependencies = {}, peerDependencies = {} } = JSON.parse( | ||
fs.readFileSync(path.join(cwd, 'package.json'), 'utf8') | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not needed as tsup by default ignores all deps, including peerDeps.
...Object.keys(dependencies), | ||
...Object.keys(peerDependencies), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar to my comment on the same earlier. this can be removed.
'react-textarea-autosize', | ||
], | ||
outExtension: (ctx) => { | ||
return { js: `.${ctx.format === 'esm' ? 'es' : ctx.format}.js` }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is incorrect, if you match the rollup output, you'd want to change this to:
js: ctx.format === 'esm' ? '.es.js' : '.js'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In roll-up config file output extension format is es.js
for esm
and cjs.js
for cjs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But for the build of Plate, if run rollup (basically clone, install and build), you'd see that cjs.js is not what you get. It's either es.js or .js.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I have checked it here in package.json of package
"main": "dist/index.js", "module": "dist/index.es.js",
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✨
I will close this pull request as stale. Thank you for your efforts! |
fix #2627
/claim #2627
Pull Request Description
p:build
scripts in the root package to use Tsup instead of Rollup.p:build:watch
script in the root package to use Tsup with the--watch
flag for automatic rebuilds on file changes.g:build:watch
to build and watch all packages concurrently (using turbo).www
when changes occur in any file in packages, using transpilePackages. Currently, with Rollup, a restart is necessary. Modify the configuration to support hot reloading seamlessly. This is the main goal of that issue.