bluealso some source map support but that's irrelevant for production
bluethere's nothing you're gonna gain from using esbuild-svelte, except for relying on someone else's code, which is almost always bad
blueif you need support for preprocessing, we can add it, and that would mostly amount of passing an option to @primate/svelte and then calling `preprocess`, though what would you gain from? ts is already nativel supported in svelte 5
bluewe'd only need it if we wanted support for additional template engines like pug or scss or so, all garbage in its own right
phalethimport sveltePlugin from "esbuild-svelte";
phalethimport { sveltePreprocess } from 'svelte-preprocess';
phaleth preprocess: sveltePreprocess(),
phaleth app.plugin("client", sveltePlugin({
phaleth }));
phalethit's two things
blueyeah but the preprocessor isn't for optimising the build. it's for supporting magical stuf flike postcss and friends
phalethI don't really exactly know, but I don't think svelte based sites ship extra 23 gzipped KBs
nevetGitHub - sveltejs/svelte-preprocess: A ✨ magical ✨ Svelte preprocessor with sensible defaults and support for: PostCSS, SCSS, Less, Stylus, Coffeescript, TypeScript, Pug and much more.
blue"Historically, svelte-preprocess was the go-to option whenever you had a language other than JS/HTML/CSS used inside your Svelte files. Today, depending on your setup, you may no longer need it:"
phalethheh, magical, it's all magical
blue"If you're using Svelte 5 and are only using type features of TypeScript (i.e. things that just "go away" after transpiling to JS), you don't need any preprocessor, Svelte handles this natively
blue"
bluebelieve me, we're gonna gain nothing from this nonsense, I've been over these packages and they're a bunch of cruft
blueunless we wanna support scss or coffeescript or pug, of all which are useless
phalethbut still why is there half the unnecesary JS in the final bundle
blueI don't know, but I doubt using esbuild-svelte or svelte-preprocess is gonna influence that
phalethI don't think the compiler just optimizes the output
blueI can't see any magical things they do that we don't do
phalethso then all esbuild based svelte sites ship extra JS
phaleththat makes rollup the tool of choice for prod builds
phalethor rolldown or whatever is the thing nowadays
blueI doubt that. though if anything unneeded is pulled in, that would be primate's fault and not esbuild's
phalethI'm just thinking that cause I remember hello world in svelte was 9 kBs back in the day
blueand then rollup wouldn't do a better job at it, anyway
phalethyeah, but if you look at that app bundle the first half of it is no primate at all
phalethand also why make a new framework if svelte is fine :D
bluewhich part? the svelte error messages?
phalethyeah, prolly, it's like all the svelte features that are not used are included