Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow user's esbuild config to override platform #40

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

evanwalsh
Copy link

This is a simple change that won't be useful for most users of this library. However, I'm trying to use karma-esbuild with some tests that run in an Electron app that has full Node.js access within its renderer.

While running Karma tests that're compiled with karma-esbuild, I get errors like:

ERROR [esbuild]: Build failed with 1 error:
src/helpers/fs.ts:1:40: error: Could not resolve "fs" (use "platform: 'node'" when building for node)

This PR lets the user's config override the default browser platform. I looked into adding tests for this, but the best way to do it would be to setup a whole Electron config within a fixture, which might be an extra dependency you'd rather not have here for a single line getting moved.

Let me know and I can make it happen! Thanks to everyone that has worked on this library and made it so easy to integrate.

@jridgewell
Copy link
Collaborator

I wonder if there's a way to add a test case for this.

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