ef4 / decorator-transforms

Better babel transforms for decorators
8 stars 5 forks source link

Why is syntax-decorators required instead of imported? #20

Open NullVoxPopuli opened 7 months ago

NullVoxPopuli commented 7 months ago

Was just browsing the code and saw: https://github.com/ef4/decorator-transforms/blob/e1fa55099bb70ce9cc6401ca5f6a1d6ff0520e72/src/index.ts#L7

In particular, I was trying to use decorator-transforms in the browser, with @babel/standalone, but use of node:module does not permit this.

davidtaylorhq commented 5 months ago

I was trying to use decorator-transforms in the browser

We'd also like to use decorator-transforms in a non-node environment (In our case that's mini_racer).

It looks like this node:module thing was added in 31529929 to 'fix cjs loading'. I can't claim to understand the intricacies of esm/cjs intercompatibity... but through trial & error I was able to get things working in both node and our miniracer environment via #27