eleventy-plugin-embed-svelte icon indicating copy to clipboard operation
eleventy-plugin-embed-svelte copied to clipboard

Add rollupResolveOptions

Open yuw27b opened this issue 4 years ago • 3 comments

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().

yuw27b avatar May 12 '21 06:05 yuw27b

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 avatar May 24 '21 19:05 shalomscott

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?

shalomscott avatar May 24 '21 20:05 shalomscott

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... :(

yuw27b avatar May 26 '21 14:05 yuw27b