mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 20:21:25 +08:00
FIX: Can't load service-worker.js
in production.
This commit is contained in:
@ -146,7 +146,10 @@ class StaticController < ApplicationController
|
||||
def service_worker_asset
|
||||
respond_to do |format|
|
||||
format.js do
|
||||
render plain: Rails.application.assets["service-worker.js"].to_s
|
||||
render(
|
||||
plain: Rails.application.assets_manifest.find_sources('service-worker.js').first,
|
||||
content_type: 'application/javascript'
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -82,11 +82,19 @@ module Discourse
|
||||
end]
|
||||
|
||||
config.assets.precompile += %w{
|
||||
vendor.js admin.js preload-store.js
|
||||
browser-update.js break_string.js ember_jquery.js
|
||||
pretty-text-bundle.js wizard-application.js
|
||||
wizard-vendor.js plugin.js plugin-third-party.js
|
||||
vendor.js
|
||||
admin.js
|
||||
preload-store.js
|
||||
browser-update.js
|
||||
break_string.js
|
||||
ember_jquery.js
|
||||
pretty-text-bundle.js
|
||||
wizard-application.js
|
||||
wizard-vendor.js
|
||||
plugin.js
|
||||
plugin-third-party.js
|
||||
markdown-it-bundle.js
|
||||
service-worker.js
|
||||
}
|
||||
|
||||
# Precompile all available locales
|
||||
|
Reference in New Issue
Block a user