Skip to content

add solid_options for solid babel plugin options#13

Open
JLarky wants to merge 1 commit intosolidjs-community:mainfrom
JLarky:feature-solid-options
Open

add solid_options for solid babel plugin options#13
JLarky wants to merge 1 commit intosolidjs-community:mainfrom
JLarky:feature-solid-options

Conversation

@JLarky
Copy link
Copy Markdown

@JLarky JLarky commented Oct 27, 2024

This PR allows you to tweak solid options, like using hydratable option.

image

Comment thread src/preset.ts
import * as tsup from 'tsup'
import * as esbuild from 'esbuild'
import { solidPlugin } from 'esbuild-plugin-solid'
import { type Options, solidPlugin } from 'esbuild-plugin-solid'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please alias Options or the while import as solid so it's obvious what Options is.

Comment thread src/preset.ts
*
* @default {}
*/
solid_options?: Options['solid'] | undefined
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why only "solid" field?

Comment thread src/preset.ts
Comment on lines -250 to +269
solidPlugin({ solid: { generate: type.server ? 'ssr' : 'dom' } }),
solidPlugin({
solid: {
generate: type.server ? 'ssr' : 'dom',
...type.solid_options,
},
}),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo this should be added to preset, not entry, options as (type: EntryType) => SolidPluginOptions. And without merging with the default one. Either user provides options or we.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants