Support webpacker live-reloading on Docker (#26419)
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							0719216368
						
					
				
				
					commit
					286a21afdc
				
			@@ -34,7 +34,8 @@ Rails.application.config.content_security_policy do |p|
 | 
			
		||||
  p.worker_src      :self, :blob, assets_host
 | 
			
		||||
 | 
			
		||||
  if Rails.env.development?
 | 
			
		||||
    webpacker_urls = %w(ws http).map { |protocol| "#{protocol}#{Webpacker.dev_server.https? ? 's' : ''}://#{Webpacker.dev_server.host_with_port}" }
 | 
			
		||||
    webpacker_public_host = ENV.fetch('WEBPACKER_DEV_SERVER_PUBLIC', Webpacker.config.dev_server[:public])
 | 
			
		||||
    webpacker_urls = %w(ws http).map { |protocol| "#{protocol}#{Webpacker.dev_server.https? ? 's' : ''}://#{webpacker_public_host}" }
 | 
			
		||||
 | 
			
		||||
    p.connect_src :self, :data, :blob, assets_host, media_host, Rails.configuration.x.streaming_api_base_url, *webpacker_urls
 | 
			
		||||
    p.script_src  :self, :unsafe_inline, :unsafe_eval, assets_host
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user