Currently, when implementing the load function for a plugin, Rollup expects either a raw code string, or a code and map pair to be returned. Being able to return a JS AST would be more direct, as generating JS strings and then recompiling them is highly inefficient and unnecessary for many plugins. Also, the ESTree spec allows for location information to be stored in the AST, which would eliminate the need to resolve a chain of source mappings.
Currently, when implementing the
loadfunction for a plugin, Rollup expects either a raw code string, or a code and map pair to be returned. Being able to return a JS AST would be more direct, as generating JS strings and then recompiling them is highly inefficient and unnecessary for many plugins. Also, the ESTree spec allows for location information to be stored in the AST, which would eliminate the need to resolve a chain of source mappings.