Skip to content
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

feat(rollup): use .cjs file extension for config files #29196

Merged
merged 4 commits into from
Dec 4, 2024

Conversation

jaysoo
Copy link
Member

@jaysoo jaysoo commented Dec 4, 2024

The rollup.config.js file will be resolved as ESM if the closest package.json has type: 'module. This causes an error when computing the project graph and when reading the file for builds.

  Original error: require is not defined in ES module scope, you can use import instead

This PR also updates the output directory to {projectRoot}/dist for the new TS setup.

Current Behavior

nx g @nx/react:lib --bundler=rollup has an error due to Node resolution

Expected Behavior

nx g @nx/react:lib --bundler=rollup works out of the box

Related Issue(s)

Fixes #29193, #29195

@jaysoo jaysoo requested review from a team as code owners December 4, 2024 15:20
Copy link

vercel bot commented Dec 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Dec 4, 2024 5:45pm

@jaysoo jaysoo force-pushed the feat/rollup-config-cjs branch from dbd06ca to ffff293 Compare December 4, 2024 15:56
jaysoo and others added 2 commits December 4, 2024 11:34
…get.ts

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
@jaysoo jaysoo force-pushed the feat/rollup-config-cjs branch from 7e328e5 to 34de59f Compare December 4, 2024 17:09
@jaysoo jaysoo force-pushed the feat/rollup-config-cjs branch from 34de59f to 012371f Compare December 4, 2024 17:42
@jaysoo jaysoo enabled auto-merge (squash) December 4, 2024 17:44
@jaysoo jaysoo merged commit 6c5916a into master Dec 4, 2024
6 checks passed
@jaysoo jaysoo deleted the feat/rollup-config-cjs branch December 4, 2024 17:53
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generated @nx/react:library Rollup Config Incompatible with package.json type: module in Nx 20.2.0-beta.6
4 participants