reversecompat: underscore

Backward compatibility for plugins that were written when underscore lived at src/static/js/underscore.js.
This commit is contained in:
John McLear 2021-02-26 10:25:41 +00:00
parent 50782bd03a
commit c0ec28f781
2 changed files with 9 additions and 0 deletions

View file

@ -146,6 +146,14 @@ const minify = async (req, res) => {
filename = 'js/vendors/jquery.js';
}
// Backward compatibility for plugins that were written when underscore lived at
// src/static/js/underscore.js.
if (['js/underscore.js', 'plugins/ep_etherpad-lite/static/js/underscore.js']
.indexOf(filename) !== -1) {
logger.warn(`request for deprecated underscore path: ${filename}`);
filename = 'js/vendors/underscore.js';
}
/* Handle static files for plugins/libraries:
paths like "plugins/ep_myplugin/static/js/test.js"
are rewritten into ROOT_PATH_OF_MYPLUGIN/static/js/test.js,

View file

@ -83,4 +83,5 @@
, "pluginfw/hooks.js"
]
, "jquery.js": ["jquery.js"]
, "underscore.js": ["underscore.js"]
}