Using episerver 8+, can you in some way tell epi to instead of reading ex. the file (in EPiServer.Cms.Shell.UI.zip) "[version]\ClientResources\epi-cms\widget\FileList.js", read another file located somewhere else on disk?
And yes, I know this can break episerver in so many wonderful ways..
Apparently I could simply add the file to the module.config file, like so:
<add name="epi-cms.widgets.base" path="my/modified/version/of/a/dojo/file.js" resourceType="Script"/>
And it will be used instead of the original function, I assume because the dojo system only load one "define(..." once, and mine is loaded before the original (in widgets.js). Though I fear this can sometimes break depending on the order the files are loaded.
This could lead to multiple define errors in the AMD loader. A better approach would be to use an alias. This is a bit of configuration in the module.config that says run my file instead, e.g.:
<?xml version="1.0" encoding="utf-8" ?>
<add name="my-app" location="ClientResources" />
<add from="epi-cms/widget/FileList" to="my-app/FileList" />
Nice, this seem like a cleaner approach.
Can you register a dojo alias programmatically?
Edit: Ah, I seem to be lost anyways on what exactly I should set. Could you possibly write up a complete modules.config example to replace:
The files will be identical, im just trying to understand exactly how the aliases work here.
© Episerver 2017 |
About Episerver World