-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
chore(rollup): clarify the callback argument 'e' to 'entry' #2952
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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. |
Open in Stackblitz • demo • starter
commit: |
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 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)) }), |
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 looks good.
rollup.config.mjs
Outdated
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' |
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.
No thanks. It doesn't feel more readable.
rollup.config.mjs
Outdated
...(configKey === 'index' | ||
? [createDeclarationConfig(`src/${configKey}.ts`, 'dist')] | ||
: []), | ||
createCommonJSConfig(`src/${configKey}.ts`, `dist/${configKey}.js`), | ||
createESMConfig(`src/${configKey}.ts`, `dist/esm/${configKey}.mjs`), |
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.
No thanks.
e0690b7
to
dfd1b0e
Compare
@dai-shi I reflected your opinions. |
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.
Thanks. Send two more PRs.
Summary
rollup.config.mjs
Check List
pnpm run fix:format
for formatting code and docs