Answer the question
In order to leave comments, you need to log in
Is it possible to add custom algorithm on top of rails js uglifier?
I have scripts written in coffee. In the process of precompiling resources, they are converted into javascript, comments are removed, minification, gluing, etc. But there is a desire to add your own handiwork to the resulting code. Those. I would like to take the result of uglifier and still make fun of the code. I seem to have met such an opportunity, but then it was not needed.
Answer the question
In order to leave comments, you need to log in
rusrails.ru/asset-pipeline#javascript-coffeescript...
I found where I saw it, but then how to start the standard compressor first, and then your own:
Настройки конфигурации компрессора для CSS и JavaScript также могут принимать любой объект. Этот объект должен иметь метод compress, принимающий строку как единственный аргумент, и он должен возвращать строку.
class Transformer
def compress(string)
do_something_returning_a_string(string)
end
end
config.assets.css_compressor = Transformer.new
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question