mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
DEV: Fix build due to highlight.js branch issue (#12441)
Highlight.js changed their default branch from master to main. This switches to the @highlightjs/cdn-assets package, thus sidestepping the problem. It's a slightly cleaner integration though (no need to build locally anymore).
This commit is contained in:
@ -101,7 +101,7 @@ def dependencies
|
||||
}, {
|
||||
source: 'handlebars/dist/handlebars.runtime.js'
|
||||
}, {
|
||||
source: 'highlight.js/build/.',
|
||||
source: '@highlightjs/cdn-assets/.',
|
||||
destination: 'highlightjs'
|
||||
}, {
|
||||
source: 'jquery.autoellipsis/src/jquery.autoellipsis.js',
|
||||
@ -265,16 +265,9 @@ task 'javascript:update' => 'clean_up' 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")
|
||||
|
||||
puts "Cleanup unused styles folder"
|
||||
system("rm -rf node_modules/highlight.js/build/styles")
|
||||
if src.include? "highlightjs"
|
||||
puts "Cleanup highlightjs styles and install smaller test bundle"
|
||||
system("rm -rf node_modules/@highlightjs/cdn-assets/styles")
|
||||
|
||||
# We don't need every language for tests
|
||||
langs = ['javascript', 'sql', 'ruby']
|
||||
|
Reference in New Issue
Block a user