I had an issue with using underscore with esbuild, and reported it to underscore's issue tracker. But it seems the issue may be due to esbuild so I thought to bring back the issue here.
I'm not versed enough neither into underscore nor into esbuild to evaluate the situation, but from the nice and detailed explanations a maintainer of underscore gave me, I understand the following:
The following:
const _ = require("underscore");
may be translated to:
import * as _ from 'underscore';
by esbuild, while the expectation from underscore's maintainers is that it would be translated to:
import _ from 'underscore';
This causes some issues as outlined in this issue.
The detailed answer from @jgonggrijp also gives much more explanations and background.
I'm just making myself the messenger here, in case that would be a useful feedback for esbuild. But I'm aware that may be a voluntary choice for esbuild to behave this way. So feel free to close this issue if you don't find it relevant. The issue is not big and there are workarounds, so I wrote this issue just in case that's of any use for improving esbuild.
In any case thanks for the great tool :)
I had an issue with using underscore with esbuild, and reported it to underscore's issue tracker. But it seems the issue may be due to esbuild so I thought to bring back the issue here.
I'm not versed enough neither into underscore nor into esbuild to evaluate the situation, but from the nice and detailed explanations a maintainer of underscore gave me, I understand the following:
The following:
may be translated to:
by esbuild, while the expectation from underscore's maintainers is that it would be translated to:
This causes some issues as outlined in this issue.
The detailed answer from @jgonggrijp also gives much more explanations and background.
I'm just making myself the messenger here, in case that would be a useful feedback for esbuild. But I'm aware that may be a voluntary choice for esbuild to behave this way. So feel free to close this issue if you don't find it relevant. The issue is not big and there are workarounds, so I wrote this issue just in case that's of any use for improving esbuild.
In any case thanks for the great tool :)