astexplorer
astexplorer copied to clipboard
Add support for including external scripts/libraries
Sometimes I wish I could use lodash when experimenting with a plugin.
Maybe we can use https://unpkg.com/ to achieve that?
Possibly? What wondering how it would be able to handle pkgs that don't produce a built file and use require though. This was an issue for babel plugins in the repl unless it auto bundles them like in https://wzrd.in/ (browserify as a service)
https://github.com/babel/babel.github.io/issues/858
You load them from bundle.run which is a Rollup/Browserify as a service with a CDN.
how exactly do you use bundle.run in astexplorer?
I think this could be easily solved if the plugin/transform gets loaded as esm instead of transforming it to commonjs. Browser already natively support importing from a remote url:
import * as m from "https://esm.sh/@codemod/[email protected]";