NodeBB/nodebb-plugin-markdown

Add higlight.js as module via Webpack

Dravere opened this issue ยท 4 comments

I saw in the commit history that you tried to add highlight.js as a module. Sadly they seem to only support Node style module via npm. Thus you reverted back to the previous type.

I'm considering achieving this in my fork of this plugin via Webpack. Webpack could repackage the highlight.js module to AMD. Which would then work with NodeBB. Is this something you would accept as a pull request?

Obviously this would mean that before every publish Webpack needs to be run, so the higlight.js is repackaged.

Hah yes, I think I actually tried to implement highlight.js via the npm module twice. I forgot what happened the first time ๐Ÿคฆโ€โ™‚๏ธ

If you could achieve this with Webpack, I'd be grateful. I think we can use an npm prepublish script to invoke webpack to build a new highlight.js file from source, right?

You seem to know what you're doing, I've added you as a collaborator to the repo. Don't go adding bitcoin miners or anything to the plugin, okay? ๐Ÿ˜†

Haha ... no Bitcoin, gotcha, Dogecoin it is then ๐Ÿ˜

I'll work out a proposal in a separate branch and submit a pull request. And yes I think it should work via prepbulish script. I'm still kind of new in Webpack and it is an intimidating tool.

@Dravere, @barisusakli is working on implementing webpack in core, so this might be something that interests you. We're hoping to deprecate require.js and use webpack exclusively ๐Ÿ˜ฌ