type-graphql icon indicating copy to clipboard operation
type-graphql copied to clipboard

Add `browser` field to package.json for frontend use

Open campbellwmorgan opened this issue 3 years ago • 4 comments

  • The browser-shim works nicely when trying to share code between frontend and backend, however manual overrides can be tricky
  • Many build systems (including webpack) will take the script from the browser field simplifying this process

campbellwmorgan avatar Oct 07 '21 16:10 campbellwmorgan

Any updates here @MichalLytek? I know its a small change, but it would help me fixing this in many projects and for the future.

itpropro avatar Jan 09 '22 00:01 itpropro

I'm not convinced about this.

TypeGraphQL can also normally work on frontend (e.g. https://github.com/MichalLytek/type-graphql/tree/master/examples/apollo-client). And looks like with this change, bundlers will start using shim instead of the real package 😕

MichalLytek avatar Jan 09 '22 08:01 MichalLytek

I'm not convinced about this.

TypeGraphQL can also normally work on frontend (e.g. https://github.com/MichalLytek/type-graphql/tree/master/examples/apollo-client). And looks like with this change, bundlers will start using shim instead of the real package confused

It does not work on framework like SvelteKit for frontend (but it does work for backend).

ibilux avatar Nov 03 '22 22:11 ibilux

This PR fixed the problem in SvelteKit !

ibilux avatar Nov 04 '22 11:11 ibilux