Closed tmpfs closed 3 years ago
It makes perfect sense, since it might also be used in node too.
What is spack
?
I disagree that it makes sense. The browser
field is for ESM imports and CJS require calls within the package but crypto-browserify
never imports or requires the crypto
module, therefore the field is redundant. More information about the browser field specification.
The spack
bundler is from the swc
project: https://swc.rs/
No, the browser field is NOT and never has been for ESM imports - it is ALWAYS and ONLY for CJS.
If spack
breaks on it, then spack is broken. This package has been configured this way since npm existed.
No, the browser field is NOT and never has been for ESM imports - it is ALWAYS and ONLY for CJS.
If
spack
breaks on it, then spack is broken. This package has been configured this way since npm existed.
Not much point discussing this further as you don't seem to understand the thrust of my point that the browser
field applies in the context of this package. There is absolutely no reason that browser
should only be applied to commonjs after all it is about the runtime environment not the way a module is referenced.
That is what the specification for the browser field says, so you’re incorrect.
This doesn't make sense for a package that is meant to be a shim for the browser and also it creates a segfault when using spack and aliasing
crypto
tocrypto-browserify
.