I think i should be able to build all 5 million language definitions to JSON modules and pop them somewhere accessible relatively easily. Since the preprocessor runs in a worker, loading modules on demand is a little more complicated than it might be. Bundling them and loading them up-front is not an option.
Currently, the browser build completely removes any highlighting because highlighting depends on node require calls. If I wrap those require calls in a function to decouple the loading from any particular mechanism, I could use require in node builds and something else in the browser. I don't think dynamic imports inside workers are well supported but I could use importScript() calls for this in the worker (which is also how mdsvex itself is loaded).
This might work. I think this would fix #65 as well.
I think i should be able to build all 5 million language definitions to JSON modules and pop them somewhere accessible relatively easily. Since the preprocessor runs in a worker, loading modules on demand is a little more complicated than it might be. Bundling them and loading them up-front is not an option.
Currently, the browser build completely removes any highlighting because highlighting depends on node
require
calls. If I wrap those require calls in a function to decouple the loading from any particular mechanism, I could use require in node builds and something else in the browser. I don't think dynamic imports inside workers are well supported but I could useimportScript()
calls for this in the worker (which is also how mdsvex itself is loaded).This might work. I think this would fix #65 as well.