DEV: Allow us to use Ember CLI assets in production

This adds an optional ENV variable, `EMBER_CLI_PROD_ASSETS`. If truthy,
compiling production assets will be done via Ember CLI and will replace
the assets Rails would otherwise use.
This commit is contained in:
Robin Ward
2021-05-05 09:02:48 -04:00
parent a341dba5d9
commit 18c5e9338f
6 changed files with 110 additions and 7 deletions

View File

@@ -13,6 +13,28 @@ module ApplicationHelper
@extra_body_classes ||= Set.new
end
def discourse_config_environment
# TODO: Can this come from Ember CLI somehow?
{ modulePrefix: "discourse",
environment: Rails.env,
rootURL: Discourse.base_path,
locationType: "auto",
historySupportMiddleware: false,
EmberENV: {
FEATURES: {},
EXTEND_PROTOTYPES: { "Date": false },
_APPLICATION_TEMPLATE_WRAPPER: false,
_DEFAULT_ASYNC_OBSERVERS: true,
_JQUERY_INTEGRATION: true
},
APP: {
name: "discourse",
version: "#{Discourse::VERSION::STRING} #{Discourse.git_version}",
exportApplicationGlobal: true
}
}.to_json
end
def google_universal_analytics_json(ua_domain_name = nil)
result = {}
if ua_domain_name