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

chore(rollup): clarify the callback argument 'e' to 'entry' #2952

Merged

Conversation

sukvvon
Copy link
Contributor

@sukvvon sukvvon commented Jan 12, 2025

Summary

  • Clarify variables in rollup.config.mjs

Check List

  • pnpm run fix:format for formatting code and docs

Copy link

vercel bot commented Jan 12, 2025

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

Name Status Preview Comments Updated (UTC)
zustand-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 12, 2025 5:34am

Copy link

codesandbox-ci bot commented Jan 12, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link

pkg-pr-new bot commented Jan 12, 2025

Open in Stackblitzdemostarter

npm i https://pkg.pr.new/zustand@2952

commit: dfd1b0e

Copy link
Member

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, I don't think what we have now doesn't look so bad.

@@ -50,7 +50,7 @@ function createESMConfig(input, output) {
output: { file: output, format: 'esm' },
external,
plugins: [
alias({ entries: entries.filter((e) => !e.find.test(input)) }),
alias({ entries: entries.filter((entry) => !entry.find.test(input)) }),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good.

Comment on lines 94 to 100
const argKeys = Object.keys(args)
let configKey = argKeys.find((argKey) => argKey.startsWith('config-'))

if (configKey) {
configKey = configKey.slice('config-'.length).replace(/_/g, '/')
} else {
c = 'index'
configKey = 'index'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No thanks. It doesn't feel more readable.

Comment on lines 104 to 108
...(configKey === 'index'
? [createDeclarationConfig(`src/${configKey}.ts`, 'dist')]
: []),
createCommonJSConfig(`src/${configKey}.ts`, `dist/${configKey}.js`),
createESMConfig(`src/${configKey}.ts`, `dist/esm/${configKey}.mjs`),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No thanks.

@sukvvon
Copy link
Contributor Author

sukvvon commented Jan 12, 2025

@dai-shi I reflected your opinions.

Copy link
Member

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Send two more PRs.

@sukvvon sukvvon changed the title chore(rollup): clarify variables chore(rollup): clarify the callback argument 'e' to 'entry' Jan 12, 2025
@dai-shi dai-shi merged commit 58d4b08 into pmndrs:main Jan 12, 2025
28 checks passed
@sukvvon sukvvon deleted the chore/clarify-variables-in-rollup-config branch January 12, 2025 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants