becdavid
(Becdavid)
June 1, 2022, 1:43pm
1
I’m currently working on custom branding for Maple’s MFEs and I’m running into some problems. I followed the instructions listed here :
GitHub - openedx/brand-openedx .
I installed from a directory under the @edx /brand alias following the instructions here :
https://open-edx-proposals.readthedocs.io/en/latest/architectural-decisions/oep-0048-brand-customization.html .
I then try to pull in the assets from @edx /brand into the MFE using code similar to
import StudioLogoSVG from '@edx/brand/studio-logo.svg';
This gives me the following error in the browser:
Compiled with problems:
Error:
Module not found: Error: Can't resolve 'react' in '/edx/app/src/brand-educateworkforce'
Has anyone else run into this problem? Have I configured something incorrectly? Any help would be appreciated.
@Zachary_Trabookis
@arbrandes Could you comment on this? We’re just trying to replace the logo and use edX branding for all our MFE as noted in oep-0048.
dcoa
(Diana Olarte)
June 1, 2022, 2:26pm
3
Hi, if you are working on dev mode I think is better if you use the module.config.js
This is explained here:
Alright! I got it to work!
module.config.js contents:
module.exports = {
localModules: [
// This line intercepts imports for the header's stylesheet and redirects them to the `src` directory of your local checkout of the header, which is where index.scss lives.
{ moduleName: '@edx/frontend-component-header/dist', dir: '../frontend-component-header', dist: 'src' },
// This line catches JavaScript imports and points them at that same src directory.
{ moduleName: '@edx/frontend…
And you can see it here too:
And now I only tested with aliases installing a repository like this:
npm install --save @edx/brand@<myuser>/brand-openedx
I hope this could help you
1 Like