Hi, I know topics about MFE have been brought up many times before, but I am just going to start a new post because most of them are already closed.
I am trying to customize the theme on my MFE plugins by adding my own logo and changing some styles from a remote repository, but I haven’t been able to get my changes to work.
I have been trying to follow the instructions from
- https://github.com/overhangio/tutor-mfe?tab=readme-ov-file#mfe-management
- https://github.com/openedx/brand-openedx
And a few threads on similar issues:
Here’s what I did:
Creating a new plugin and adding a patch:
- Created a new plugin with this patch:
from tutor import hooks
hooks.Filters.ENV_PATCHES.add_item(
(
"mfe-dockerfile-post-npm-install",
"""
RUN npm install '@edx/brand@git+<my remote repository>'
"""
)
)
- Push changes to remote repository
- Making sure that I have my plugin listed and enabled
tutor plugins enable <myplugin>
- Check tutor root config.yml to make sure the new plugin is included.
- Check tutor plugins list to make sure the new plugin has the version pointing to my local directory where the new plugin .py file is.
Setting up tutor-indigo
I think these npm install commands are overwriting my custom new plugin patch based on what I found in my docker build logs when I’m rebuilding the mfe images. They ran after my npm install openedx/brand-openedx
RUN npm install '@edx/brand@npm:@edly-io/indigo-brand-openedx@^2.1.1'
RUN npm install '@edx/frontend-component-header@npm:@edly-io/indigo-frontend-component-header@^3.1.3'
RUN npm install @edly-io/indigo-frontend-component-footer@^2.0.0
Here’s what I did:
- Fork and clone from overhangio/tutor-indigo
- Remove the entire mfe patch from
tutorindigo/plugin.py
- Run
tutor mounts add <path to local tutor-indigo>*
- Run
tutor config save
Setting up openedx/brand-openedx
- Fork and clone from openedx/brand-openedx
- Replace the logos with my own, and making sure the names stay the same.
- Modify _overrides.scss:
#root .learner-variant-header {
background-color: #9e1b34;
}
- Run
tutor config save
- Run
tutor images build --no-cache --no-registry mfe
(Pain in the ass building with just single CPU otherwise it would fail) - Check my docker build logs, and it did run
npm install '@edx/brand@git+<my remote repository>,'
, and the mfe patches I removed from tutor-indigo are not in the logs. - Run
tutor local launch
However, my local instance still shows the default indigo theme and logos. Am I missing something? I’m running tutor v18.1.3