sveltejs / rollup-plugin-svelte

Compile Svelte components with Rollup
MIT License
500 stars 79 forks source link

Browser Support #92

Open curran opened 4 years ago

curran commented 4 years ago

I notice that this plugin is not used in the Svelte REPL implementation, but instead the REPL indroduces its own Rollup plugin https://github.com/sveltejs/svelte-repl/blob/master/src/workers/bundler/index.js#L101

I'm just curious why is this? Might it make sense to instead use this package (rollup-plugin-svelte) inside the REPL and unify the duplication? If not, what is the barrier? I see lots of non-browser-compatible invocations such as writeFileSync https://github.com/sveltejs/rollup-plugin-svelte/blob/master/index.js#L101, and am wondering if they could be possibly refactored to support a browser environment as well.

I'm currently exploring ways of compiling Svelte programs in the browser and am eager to learn the best way to make this happen.

swyxio commented 4 years ago

you might also draw inspiration from @pngwn's work here https://github.com/pngwn/bristech-2019