live_svelte icon indicating copy to clipboard operation
live_svelte copied to clipboard

build.js for esbuild 0.17+

Open dev-guy opened this issue 2 years ago • 3 comments

Thank you for updating build.js to use svelte-preprocess!

I ran mix live_svelte.setup with live_svelte version 0.11.0. build.js only works with esbuild version 0.16.x and earlier because the 'watch' implementation changed.

If you don't pin esbuild to version 0.16.x in package.json, build.js should look something like this.

dev-guy avatar Aug 09 '23 17:08 dev-guy

Is this the same issue as: https://github.com/woutdp/live_svelte/issues/29

woutdp avatar Aug 09 '23 17:08 woutdp

Per #29, this doesn't work in Docker? I don't recall where I saw that. If the old watch style is required by build.js, I think the README should specify pinning the version of esbuild and perhaps mention this issue if users want to upgrade.

dev-guy avatar Aug 09 '23 18:08 dev-guy

It's something I have to take a look at again, if I can make the new version work I'll update the build.js file to use the latest version

woutdp avatar Aug 09 '23 18:08 woutdp

I think this might be solved by now, official documentation supports the new version: https://hexdocs.pm/phoenix/asset_management.html#esbuild-plugins

This will be released in the new version together with Svelte 5 (soon :tm:)

https://github.com/woutdp/live_svelte/commit/582ecd9442be6f66c75fb89e0486f2d3e03b7356

woutdp avatar Oct 19 '24 22:10 woutdp