ef4 / decorator-transforms

Better babel transforms for decorators

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why is syntax-decorators required instead of imported?

NullVoxPopuli opened this issue · comments

Was just browsing the code and saw:

const { default: decoratorSyntax } = req("@babel/plugin-syntax-decorators");

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

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 3152992 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