You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recognize that we probably can't just make it blankly accept dynamic imports all the time, because perhaps the evaluation of a dynamic string is or isn't an http request. At this point, I'm thinking that there needs to be some kind of configuration to allow import to work as expected in particular scenarios.
The text was updated successfully, but these errors were encountered:
How to provide a per file/line config? For example, we still want use transpiled import() to load local route pages, but want to skip transpiling on some import() fetching remote resources.
It would have to be a per-line kind of config, because we might have both use cases in the same file... I hate adding comment directives in code, but that might be a requirement here? Not sure how else we can allow the native imports... Well, another options would be to provide some kind of callback config so whenever we hit an import, we can call a user defined function to determine if we want to transpile or not.
I also thought about comments. The trouble is the parser I am using is meriyah, it doesn't have comments in AST tree (comment is not defined in estree AST spec). Eslint parser can definitely look into comments.
dumber/lib/transformers/cjs-to-amd.js
Line 64 in 13d2e1c
Reference #21
Hate to bring this back up, but it looks like maybe we missed a use case.
The change works perfect for a static url
But doesn't work with a dynamic url like this
I recognize that we probably can't just make it blankly accept dynamic imports all the time, because perhaps the evaluation of a dynamic string is or isn't an http request. At this point, I'm thinking that there needs to be some kind of configuration to allow import to work as expected in particular scenarios.
The text was updated successfully, but these errors were encountered: