This fixes an issue with scripts that rely on ESM were not working.
In case when a file has extension .js and scriptType is set to "module" in codeswing.json, before import statements were not replaced to use CDNJS (some heuristic was in place to make them work anyways if the file began with import, but not if the file didn't - such as if it started with a comment)
This fixes an issue with scripts that rely on ESM were not working.
In case when a file has extension
.js
andscriptType
is set to"module"
in codeswing.json, beforeimport
statements were not replaced to use CDNJS (some heuristic was in place to make them work anyways if the file began withimport
, but not if the file didn't - such as if it started with a comment)