#Using vitest without defining `nodejs_compat` for my worker

1 messages · Page 1 of 1 (latest)

jaunty zinc
haughty dome
#

No, the vitest integration needs it for running tests

jaunty zinc
#

@haughty dome Thanks. Thinking about it now. I guess I could just point the tests at a different toml file right?

haughty dome
#

Sure if you wanted

#

Any reason to not just enable though?

jaunty zinc
#

@haughty dome Not really, it just adds to the weight of the worker when it really isn't needed I guess.

haughty dome
#

Doesn't need to. If you do compatibility_flags = ["nodejs_compat", "no_nodejs_compat_v2"]

It'd use node compat v1, only runtime APIs. Nothing extra in the worker

jaunty zinc
haughty dome
#

Nah, it's built into the runtime. They just are usable, they don't touch your code at all.

Just like fetch and caches don't add any weight 🙂