mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 06:41:25 +08:00
DEV: Fix production sourcemaps with Ember CLI (#16707)
22a7905f restructured how we load Ember CLI assets in production. Unfortunately, it also broke sourcemaps for those assets. This commit fixes that regression via a couple of changes: - It adds the necessary `.map` paths to `config.assets.precompile` - It swaps Sprockets' default `SourcemappingUrlProcessor` with an extended version which maintains relative URLs of maps
This commit is contained in:
@ -1,6 +1,15 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module EmberCli
|
||||
ASSETS = %w(
|
||||
discourse.js
|
||||
admin.js
|
||||
ember_jquery.js
|
||||
pretty-text-bundle.js
|
||||
start-discourse.js
|
||||
vendor.js
|
||||
)
|
||||
|
||||
ALIASES ||= {
|
||||
"application" => "discourse",
|
||||
"discourse/tests/test-support-rails" => "test-support",
|
||||
@ -36,4 +45,9 @@ module EmberCli
|
||||
return name if !enabled?
|
||||
ALIASES[name] || name
|
||||
end
|
||||
|
||||
def self.is_ember_cli_asset?(name)
|
||||
return false if !enabled?
|
||||
ASSETS.include?(name) || name.start_with?("chunk.")
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user