mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 17:41:17 +08:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user