In the advanced configuration section of the read me it has this section of code:
Rails.application.config.assets.configure do |env|
env.unregister_postprocessor('application/javascript', Sprockets::Commoner::Processor)
...
end
The unregister_postprocessor call is incorrect. It requires an instance of the processor, not just the class. I used the following code in my application to get it to work properly:
Rails.application.config.assets.configure do |env|
env.postprocessors['application/javascript'].each do |processor|
if processor.class == Sprockets::Commoner::Processor
env.unregister_postprocessor('application/javascript', processor)
end
end
end
However I am not certain if this is the best way to do it since I think it is possible that env.postprocessors['application/javascript'] can be nil.
This is kind of an annoying part of sprockets, but the given code will work if the processor is not replaced by a processor by some other gem. I think I'll add a helper method to commoner to make this easier
In the advanced configuration section of the read me it has this section of code:
The
unregister_postprocessor
call is incorrect. It requires an instance of the processor, not just the class. I used the following code in my application to get it to work properly:However I am not certain if this is the best way to do it since I think it is possible that
env.postprocessors['application/javascript']
can be nil.