Skip to content

Add back esbuild configuration options adapters #3733

@pzuraq

Description

@pzuraq

Describe the problem

For local and testing builds we use MockServiceWorker for our mocks. There's a Node component to the library so we can mock requests in SSR. However, it uses Node libraries, and esbuild throws an error if the platform is not set to node when we build for production. We want to test our app with a production build so that it's as close to what will actually ship as possible.

Without the esbuild configuration option, there's no way for us to change the platform specifically for test builds.

Describe the proposed solution

An option for configuring the build within adapters.

Alternatives considered

Another possibility would be changing the target/platform based on whether or not it is a "preview" build. Since previewing first requires us to build the app with a separate command, I'm not sure how this could be signaled to the build. Maybe a build flag?

Importance

i cannot use SvelteKit without it

Additional Information

Currently operating off a fork so we can use the latest SvelteKit.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions