I want Webpack to complete before the Ready Do command is fired
Trouble is the Ready do command listed below completes before Webpack - and Webpack seems to then destroy the options set - running this without Webpack I can see the options are in place.
##
# External pipeline - Webpack
##
activate :external_pipeline do | i |
i.name = :webpack
i.command = build? ? './node_modules/webpack/bin/webpack.js --bail -p' : './node_modules/webpack/bin/webpack.js --watch -d'
i.source = ".tmp/dist"
i.latency = 0
i.disable_background_execution = false
end
ready do
# Loop through the locales
locales.each_with_index do | locale, index |
# Get all the french tags
sitemap.resources.select{ | d | d.data.template }.each do | resource |
if resource.path[ 0...2 ] === locale.to_s
# Debug
puts "Processing : #{ resource.path }"
resource.add_metadata options: {
locale: locale,
lang: locale
}
end
end
end
end