Hey there,
I just figured out how to get svelte to work with esbuild, but lack the time to properly modify docs. Here's the tl;dr, though.
npm install --save-dev svelte svelte-preprocess @tsconfig/svelte esbuild-svelte
will install the bits
tsconfig.json changes remain mostly the same.
I did add a line
which overrides the setting from svelte, to enable the inline source map. Still testing this specifically.
Lastly are changes for esbuild specifically. The plugin template has an esbuild.config.mjs, which I modified.
Like the guide that ships with the package, https://www.npmjs.com/package/esbuild-svelte, first you need
import esbuildSvelte from "esbuild-svelte";
import sveltePreprocess from "svelte-preprocess";
followed by:
plugins: [
esbuildSvelte({
preprocess: sveltePreprocess(),
}),
]
for reference, this code was already included in my package.json:
"scripts": {
"dev": "node esbuild.config.mjs",
"build": "node esbuild.config.mjs production"
},
After that, everything just worked, and I was more surprised that it did at all than how easy it was :). Hope this info is useful to you, even if it accompanies no other documentation. Happy to fill in more details, if you reply here, though please note I don't always check email/messaging frequently, so it might be a day or 4 before I reply.