-
Notifications
You must be signed in to change notification settings - Fork 247
Always initialize assets environment in rake task #222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Yeah, I'd like too but there are some configuration that still changes between environment like the assets prefix and the assets host. I don't have any idea on how change this to not use environment information. |
Yeah, I dunno either :/ I think at least this compile direction will at least allow The other issue I'm still worried about is building against an uninitialized app. Is there any flag thats set after |
Yeah, |
Bah, so |
@@ -69,7 +69,11 @@ def configure(&block) | |||
Sprockets::Rails::Task.new(app) | |||
end | |||
|
|||
def self.build_environment(app) | |||
def build_environment(app, initialized: app.initialized?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little hacky, just allowing the after_init callback to skip the warning.
Always initialize assets environment in rake task
#220 causes a slight regression but brings up this weird issue again.
If
config.assets.compile = false
inproduction.rb
than you can't even dorake assets:precompile
.This is a little work around to force the environment to build even in this case.
@rafaelfranca the environment weirdness between
rake assets:precompile
has always bugged me. Given 3.x can have backwards incompatible changes, have any idea for directions we can move into to make this more clear?I really wish
rake assets:precompile
would work no matter what and always minified the assets even in RAILS_ENV=development. Would like to make it easier for people who compile assets in an isolate environment and upload them to a CDN. This sometimes happens locally on there machine and othertimes in production like environments that might not have a db.