esbuild 0.16.1
This is a hotfix for the previous release.
-
Re-allow importing JSON with the
copyloader using an import assertionThe previous release made it so when
assert { type: 'json' }is present on an import statement, esbuild validated that thejsonloader was used. This is what an import assertion is supposed to do. However, I forgot about the relatively newcopyloader, which sort of behaves as if the import path was marked as external (and thus not loaded at all) except that the file is copied to the output directory and the import path is rewritten to point to the copy. In this case whatever JavaScript runtime ends up running the code is the one to evaluate the import assertion. So esbuild should really allow this case as well. With this release, esbuild now allows both thejsonandcopyloaders when anassert { type: 'json' }import assertion is present.