This is a hotfix for the previous release.
-
Re-allow importing JSON with the
copy
loader using an import assertionThe previous release made it so when
assert { type: 'json' }
is present on an import statement, esbuild validated that thejson
loader was used. This is what an import assertion is supposed to do. However, I forgot about the relatively newcopy
loader, 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 thejson
andcopy
loaders when anassert { type: 'json' }
import assertion is present.