DEV: allows lodash to be updated with rake javascript:update (#7881)

This commit is contained in:
Joffrey JAFFEUX
2019-07-11 16:57:03 +02:00
committed by GitHub
parent 9b0be303b4
commit 550e811652
3 changed files with 151 additions and 3 deletions

View File

@ -77,6 +77,9 @@ task 'javascript:update' do
}, {
source: 'moment-timezone/builds/moment-timezone-with-data-10-year-range.js',
destination: 'moment-timezone-with-data.js'
}, {
source: 'lodash.js',
destination: 'lodash.js'
}, {
source: 'moment-timezone-names-translations/locales/.',
destination: 'moment-timezone-names-locale'
@ -124,6 +127,12 @@ task 'javascript:update' do
dest = "#{vendor_js}/#{filename}"
end
# lodash.js needs building
if src.include? "lodash.js"
puts "Building custom lodash.js build"
system('yarn run lodash include="each,filter,map,range,first,isEmpty,chain,extend,every,omit,merge,union,sortBy,uniq,intersection,reject,compact,reduce,debounce,throttle,values,pick,keys,flatten,min,max,isArray,delay,isString,isEqual,without,invoke,clone,findIndex,find,groupBy" minus="template" -d -o "node_modules/lodash.js"')
end
unless File.exists?(dest)
STDERR.puts "New dependency added: #{dest}"
end