'Is there a way to overwrite CKAN Javascript files in a plugin?

I'm writing a custom plugin for CKAN and in this plugin I want to overwrite the file https://github.com/ckan/ckan/blob/2.8/ckan/public/base/javascript/modules/image-upload.js from CKAN with a new implementation. Is there a way to do this?

I tried adding the file on the same path in the plugin, but that didn't work.



Solution 1:[1]

You can create a fanstatic directory in your extension and move the files there. Then use add_resource function to register that directory as explained here. As an additional example check this extension(register, directory)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Zoran Pandovski