withastro/adapters

Allow Third-Party override of esbuild expose settings

Closed this issue · 1 comments

Objective: We aim to enhance our adapter's flexibility and customization capabilities by exposing a subset of esbuild settings. This will enable third-party developers to override the default configurations set by our adapter with custom ones tailored to their specific needs. And to implement workarounds needed.

Background: Our current setup comes with a default configuration for esbuild that suits most use cases and follows the best-practices. However, we acknowledge the diversity of our user base and their unique requirements. By opening up the adapter for configuration overrides, we can accommodate a wider range of use-cases.

Scope of Work:

We think considering all esbuild settings should be the goal. The API could work similar to Astro's inline Vite config. Definitely we should support, external, plugins, platform, conditions

Overrides: It is important to note that, in this initial idea, we will not support merging custom configurations with the default settings. Users will need to specify their configurations fully, as these will entirely replace the defaults.

Considerations: Depending on the amount of work, we may want to opt for configuration merging. This would allow users to modify only parts of the configuration while keeping the rest as defaults.

Guidelines:

Docs: The implementation should be followed by clear documentation in the https://github.com/withastro/docs repository.

Tests: The implementation should also be provided with suitable tests (preferably using the node test runner #150)


Support: If you have any questions or need clarification on the task, please ask in the comments section of this issue early and often. Our team is here to help and provide guidance.

With the upcoming v10 version, we'll don't have the esbuild step anymore. So this is not needed anymore.