Skip to content

fix(bundle): remove inline @github deps #2404

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

Merged
merged 4 commits into from
Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/pink-jokes-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

Update bundle to not inline @github dependencies
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"codemods",
"dist",
"lib",
"lib/node_modules",
"lib-esm",
"index.d.ts",
"drafts/package.json",
Expand Down
10 changes: 3 additions & 7 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ const baseConfig = {
babelHelpers: 'inline',
babelrc: false
}),
commonjs(),
resolve({
extensions
}),
commonjs()
})
]
}

Expand All @@ -69,11 +69,7 @@ export default [
// CommonJS
{
...baseConfig,
external: isExternal(
external.filter(id => {
return !id.startsWith('@github')
})
),
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious why this filter was added in the first place. Will removing it cause any side effects?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hey @pksjce! 👋

The background for the filter was to inline the ESM-only dependencies from @github in the CommonJS bundle to get that working again. This was kind of a trade-off until we moved to ESM-only and don't have to support CommonJS anymore

Copy link
Contributor

Choose a reason for hiding this comment

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

As long as we are fine with ESM only, LGTM!

external: isExternal(external),
output: {
dir: 'lib',
format: 'commonjs',
Expand Down