Bjorn Lu

Results 767 comments of Bjorn Lu

`svelteKit:prefetch` won't work in a non-SvelteKit project either. Ideally your components should be as "dumb" as possible so it can be used generically in different projects. It shouldn't make any...

Maybe related https://github.com/sveltejs/kit/issues/3633 which suggests setting the timeout in the attribute value too.

To add on the cons, a glob having `?url` probably won't work as Vite treats it as a glob pattern naively. This could be improved in Vite though. Also, aliases...

A bit tangential, but would it make sense if we leave it as is, but for dev mode, we show VIte's error overlay of the thrown error? This could differentiate...

> How can we prefetch on **_mobile_** ? For mobile, SvelteKit listens to the `touchstart` event, which usually happens before the actual anchor navigation, so between that extra timeframe is...

Vite has plans to support importing `.js` in `.ts` files soon according to https://github.com/vitejs/vite/issues/3040#issuecomment-940697809

What about importing with `.js` in your source code? ```js //index.ts export {default as TestClass} from './TestClass.js' ``` I don't think the package command should be prepending imports with `.js`....

Hmm. I thought you can import `.ts` files with a `.js` extension? Vite already supports that. But I could be missing a point here too 😄

I think we discussed something similar too about transforming the entrypoint with only the named imports, so it works more generically. The preprocessor technique is interesting though, I suppose it...

Since `1.0.0-next.185`, you can set [experimental.prebundleSvelteLibraries: true](https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/config.md#prebundlesveltelibraries) in `svelte.config.js` to test out the new prebundling handling. Feedback appreciated!