EMH333 / esbuild-svelte

An esbuild plugin to compile Svelte components
https://www.npmjs.com/package/esbuild-svelte
MIT License
238 stars 22 forks source link

Option to enable svelte-check? #160

Closed NfNitLoop closed 1 year ago

NfNitLoop commented 1 year ago

I just realized that esbuild-svelte doesn't do type checks, because svelte preprocessor doesn't do type checks.

I'd love to (optionally) include type checks in my esbuild run because they can save me a lot of runtime headaches.

It would be nice if this were an option in esbuild-svelte so I don't have to roll my own.

I suppose as a workaround I can hack it into my package.json scripts to just run before kicking off esbuild.

EMH333 commented 1 year ago

Unfortunately I think the "hack" of adding svelte-check or something similar into your npm scripts is probably the best bet here.

esbuild doesn't do type checks either, which means there isn't really a clean way for esbuild-svelte to incorporate type checks into it's run without adding additional complexity and extraneous dependencies for non-typescript users.

Open to suggestions on this, but I see type checks as the responsibility of an external program (like svelte-check) or a preprocessor.

EMH333 commented 1 year ago

Closing this as out of scope