-
-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds Propshaft support but still maintain Sprockets support. In order to make this happen we need to deal with Tinymce assets. They need to be available without the digest. Before we were using the `NonStupidDigestAssets` gem. Now we enhance the `assets:precompile` Rake task and simply copy the digested assets to the non digested name. In development we return the undigested asset if requested.
- Loading branch information
Showing
11 changed files
with
56 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
app/assets/stylesheets/tinymce/skins/ui/alchemy/skin.mobile.min.css
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require "propshaft/asset" | ||
|
||
module Alchemy | ||
module Propshaft | ||
module TinymceAsset | ||
# Allow TinyMCE assets to be accessed (in development mode) without a digest | ||
def fresh?(digest) | ||
super || | ||
(digest.blank? && logical_path.to_s.starts_with?("tinymce/")) | ||
end | ||
end | ||
end | ||
end | ||
|
||
Propshaft::Asset.prepend Alchemy::Propshaft::TinymceAsset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
if Rake::Task.task_defined?("assets:precompile") | ||
Rake::Task["assets:precompile"].enhance do | ||
manifest_path = Rails.application.config.assets.manifest_path | ||
assets_path = Rails.root.join("public#{Rails.application.config.assets.prefix}") | ||
manifest = JSON.parse(manifest_path.read) | ||
manifest.select { |k| k.include?("tinymce/") }.each do |k, v| | ||
Propshaft.logger.info "Copying #{v} to #{k}" | ||
FileUtils.cp( | ||
assets_path.join(v), | ||
assets_path.join(k) | ||
) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters