-
Notifications
You must be signed in to change notification settings - Fork 346
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
Only enhance assets:precompile
if it exists
#372
Comments
Sure! Maybe include the option to skip via env var too :) |
@JanStevens Just made a commit to only enhance |
@PikachuEXE Thanks! I tested it with master and it works I also had to set some additional config options since they where taken from assets pipeline AssetSync.configure do |config|
# Specifies the assets prefix
config.prefix = '/assets'
# Don't run on precompile it doesn't exist
config.run_on_precompile = false
# The block should return an array of file paths
config.add_local_file_paths do
# Any code that returns paths of local asset files to be uploaded
# Like Webpacker
public_root = Rails.root.join("public")
Dir.chdir(public_root) do
packs_dir = Webpacker.config.public_output_path.relative_path_from(public_root)
Dir[File.join(packs_dir, '/**/**')]
end
end
end |
|
Hello,
I'm using rails 5.2 with webpacker without sprockets or the assets pipeline, so I don't have a assets:precompile rake task. I manually call asset sync when needed.
Would you be open for a pull request to only enhance assets:precompile when it's defined? Similar as how webpacker does it (ref: https://github.com/rails/webpacker/blob/master/lib/tasks/webpacker/compile.rake)
Regards
The text was updated successfully, but these errors were encountered: