shalomscott / eleventy-plugin-embed-svelte

An Eleventy plugin that makes embedding Svelte components in your static pages painfully easy.
https://shalomscott.github.io/eleventy-plugin-embed-svelte/
MIT License
40 stars 4 forks source link

Add rollupResolveOptions #10

Open yuw27b opened 3 years ago

yuw27b commented 3 years ago

I've added options for @rollup/plugin-node-resolve. This change makes users possible to pass options to @rollup/plugin-node-resolve which is executed by this plugin.

When I add resolve({browser: true}) to rollupInputPlugins, it will be executed after resolve() and the option{browser: true} has no effect. Therefore, I suppose it would be useful to allow users to pass options to default resolve().

shalomscott commented 3 years ago

I can't think of any reason why I shouldn't just use that option inside the plugin code. Can you think of a scenario where browser: true is not desired when bundling Svelte components?

shalomscott commented 3 years ago

While we're on this subject though, I'd love it if could have a look at #11 and let me know what you think?

yuw27b commented 3 years ago

Thanks for looking at my request!

I agree with you. As far as I know, when using svelte components in 11ty generated html, it's always for browsers.

I just wondered if there might be a case of passing another option (e.g. preferBuiltins, extensions, etc.) to resolve(), so I wrote this PR code that way. However, if you think adding rollupResolveOptions is too much, just adding {browser: true} is of course nice for me!

Also, https://github.com/shalomscott/eleventy-plugin-embed-svelte/pull/11 looks a very good idea! Using rollup.config.js is more clear to users. Though, I can't give any help how to handle rollupPluginSvelteOptions at this time... :(