So we’ve been trying to do this, but running into issues. Wondering if there are any gotchas, version incompatibilities, etc.?
For reference, this is what we did:
-
created a new branch off v2.2.2 (the current version we were using), and made a minor tweak
-
pushed it to a public gitlab repository
-
installed in the mfe as:
npm install '@edx/frontend-component-header@git+https://gitlab.com/path/to/frontend-component-header-test.git#v2.2.2'
But then, building the MFE fails to resolve @edx/frontend-component-header
:
ERROR in ./src/index.scss (./node_modules/css-loader/dist/cjs.js??ref--5-1!./node_modules/postcss-loader/src??ref--5-2!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--5-4!./src/index.scss)
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Can't find stylesheet to import.
╷
8 │ @import '~@edx/frontend-component-header/dist/index';
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
src/index.scss 8:9 root stylesheet
@ ./src/index.scss 2:26-248 22:4-35:5 25:25-247
@ ./src/index.jsx
ERROR in ./src/index.jsx
Module not found: Error: Can't resolve '@edx/frontend-component-header' in './src'
This resolving fails for any form of @edx/frontend-component-header
from css and js.
Is there some extra configuration we need, or an updated peer dependency, or …? It looks like something in the build chain isn’t following the alias, but we can’t figure out where.