adobe-dx
adobe-dx copied to clipboard
fix relative paths to react (at least in admin)
out of GH-121, here is instruction to reproduce that issue looks like if you move the build, things don't work anymore (as you could expect with hardcoded relative paths, but it does work for content & structure):
- build the whole project
-
cd apps/admin
-
mvn clean install && cd target && git clone --depth 1 --branch master [email protected]:adobe/adobe-dx.git checkout && cd checkout
from there if you cd apps/admin/app
and run the build of the app, you'll have failure, if you do the same for structure or content, it will work. We need to find a way to stop using static hardcoded paths, as we need those both context to work (this checkout context is what is done when doing a release:perform)
This is solved for now, but I think there's a more global / dynamic way to solve this issue.
For now there might be a way to use a maven profile to kick off a different npm script that would pull react from a different location. I think the root issue was related to some internal react spectrum things trying to run and dying because react was not in apps/admin/app/node_modules. The solution would most likely be:
- A new release profile that runs a different NPM script -
<arguments>run build-release</arguments>
- This would tell NPM to run with a different set of arguments that could be interpreted by webpack -
"build-release": "NODE_ENV=production webpack --mode=production --react=local",
- Webpack would pick this change up to change where react is located.
happens again on admin app, hence re-opening, i guess we should go for the long term fix you're proposing @auniverseaway