DEV: Use yarn to manage Highlight.js dependency

Moves Highlight.js files to vendor/assets/javascripts

Adds Highlight.js in yarn package management

Removes old rake task and reliance on NPM to build Highlight.js

Highlight.js is now integrated in the "javascript:update" rake task
This commit is contained in:
Penar Musaraj
2019-01-14 12:46:35 -05:00
parent 81953339f2
commit b28d68efbf
192 changed files with 31 additions and 33 deletions

View File

@ -44,6 +44,9 @@ task 'javascript:update' do
source: 'handlebars/dist/handlebars.js'
}, {
source: 'handlebars/dist/handlebars.runtime.js'
}, {
source: 'highlight.js/build/.',
destination: 'highlightjs'
}, {
source: 'htmlparser/lib/htmlparser.js'
}, {
@ -82,6 +85,18 @@ task 'javascript:update' do
filename = f[:destination]
end
# Highlight.js needs building
if src.include? "highlight.js"
puts "Install Highlight.js dependencies"
system("cd node_modules/highlight.js && yarn install")
puts "Build Highlight.js"
system("cd node_modules/highlight.js && node tools/build.js -t cdn none")
puts "Cleanup unused styles folder"
system("rm -rf node_modules/highlight.js/build/styles")
end
if f[:public]
dest = "#{public_js}/#{filename}"
else