Skip to content

Optimize dependencies for what is actually used in a production build#82

Open
ferm10n wants to merge 2 commits into
aidansunbury:mainfrom
ferm10n:optimize-deps
Open

Optimize dependencies for what is actually used in a production build#82
ferm10n wants to merge 2 commits into
aidansunbury:mainfrom
ferm10n:optimize-deps

Conversation

@ferm10n

@ferm10n ferm10n commented Jun 16, 2025

Copy link
Copy Markdown

I discovered there's a few packages being included with trpc-ui that don't need to exist in a production environment. These are either unused by the project, or only used in the react-app.

I started looking at it because trpc-ui is one of the only packages I have to externalize from my build since it does this:

const dirLocation = dirname(fileURLToPath(import.meta.url));

which doesn't work when it's in a bundle because everything ends up with the same import.meta.url (the bundle output .js). I'm not sure if/how this separate issue should be approached. including the react app bundle in js so it can be re-bundled feels wrong but I'm in uncharted territory there lol. Maybe this could become recognized somewhere as a known issue?

ferm10n added 2 commits June 16, 2025 14:23
all moved packages are just used in the `react-app`
- `node:path` is used instead of `path`
- `node:url` is used instead of `url`
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.

1 participant