You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the docs njs expect functions to be exported in the following form
exportdefault{
myFn1,
myFn2
}
It also stated that njs support only subset of js syntax. This is fine.
However, when it comes to bundling few files into one all modern bundlers such as esbuild and rollup will transform this export construction to something similar to this:
And that exact construction is not supported by njs. Unfortunately, there are no way to tune how these bundlers will output the code, hence this incompatibility make using modern bundlers completely impossible.
Browserify mentioned in the docs is dead. Last publish on npm was 2 years ago. Actually, i thought it was deprecated and abandoned in favor of webpack back in 2015, so it's not a viable solution for 2023.
The proposal is to add support this exact notation to unblock usage njs with modern bundlers such as esbuild / rollup
The text was updated successfully, but these errors were encountered:
According to the docs njs expect functions to be exported in the following form
It also stated that njs support only subset of js syntax. This is fine.
However, when it comes to bundling few files into one all modern bundlers such as esbuild and rollup will transform this export construction to something similar to this:
And that exact construction is not supported by njs. Unfortunately, there are no way to tune how these bundlers will output the code, hence this incompatibility make using modern bundlers completely impossible.
Browserify mentioned in the docs is dead. Last publish on npm was 2 years ago. Actually, i thought it was deprecated and abandoned in favor of webpack back in 2015, so it's not a viable solution for 2023.
The proposal is to add support this exact notation to unblock usage njs with modern bundlers such as esbuild / rollup
The text was updated successfully, but these errors were encountered: