Closed Xevinaly closed 2 years ago
You can use tsm
instead esm
my config with preprocessing here https://github.com/tilde-lab/svelte-spectre/tree/master/tests
Unfortunately thats only a partial solution as it would require me to switch my project over to using Typescript.
My project have TS π€·π»ββοΈ
Unfortunately thats only a partial solution as it would require me to switch my project over to using Typescript.
Itβs not necessary - tsm working with js to ππ»
Correct β you don't need to use TypeScript in order for tsm
to be useful. It's a great ESM <-> CJS tool on its own.
I'll be putting together an example of using uvu
with SvelteKit projects in the near future. Closing as duplicate of #137
SvelteKit (and any other node project which uses esm as the default using the line "type: module") is incompatible with uvu at the moment since uvu will try to load as an esm file. This causes arguments passed in using -r (JSDOM or any code to register .svelte files) to break uvu, giving the following error: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: C:\Users\xevin\OneDrive\Documents\Projects\uvu-issue-replication\tests\setup\register.js require() of ES modules is not supported.
Reproduction can be found here: https://gitlab.com/xevinaly/uvu-issue-replication