-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
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.