Closed iamskok closed 5 years ago
@davidtheclark You are totally right about Webpack.
The other way we can go about it is to register all languages by default as you used to do it and to provide a way to generate a custom template with required languages.
Interesting idea, @iamskok; but this looks like too much additional complexity for the library.
What about using dependency injection: Make refractor
itself an argument you can pass into the plugin's options; set up the current Node entrypoint to pass in all of refactor
; and expose another file where a browser user could pass in their own smaller version?
@davidtheclark Do you mind giving more information on how to do it? I'm having a hard time understanding how to make webpack load external refractor script passed by a user without adding settings to the webpack config.
@davidtheclark could you give me more information or should I close this PR?
@iamskok This is not a priority for us right now, so I don't think we'll be able to dedicate time to walking through an implementation. If you'd like to open an issue describing the problem and potential solution, we can keep that on hand in case somebody else wants to take a shot at it.
@davidtheclark Sounds reasonable, thanks for assisting me along the way.
In the meantime I leave the link on template generator https://github.com/iamskok/rehype-prism-template.
Hi @mapbox, @davidtheclark 👋
Would you be interested in my PR, which adds an option to register languages?
It will let the end user to define the languages they will actually need and as a result it will lower browser footprint.