Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rhd-frontend should build a distribution of the assets to be used by Drupal #395

Open
robpblake opened this issue Oct 24, 2019 · 2 comments

Comments

@robpblake
Copy link
Collaborator

At the minute the Dockerfile for Drupal has a number of commands to move assets from the dist directory of the rhd-frontend component around into the correct location. For example:

https://github.com/redhat-developer/developers.redhat.com/blob/master/_docker/drupal/Dockerfile.mp#L36-L56

Instead, rhd-frontend should support building it's distributable assets into a form that can be consumed directly by Drupal. This distribution should be produced by a single command. For example npm run build-drupal-distribution. Once this command has run, the dist directory of the rhd-frontend component should be in a state that can be consumed directly by Drupal.

How it is to be consumed by Drupal is then a choice of Drupal. We can either include it directly on the Drupal filesystem via our current mechanism, or alternatively we can upload the dist directory to a CDN and have Drupal consume it from there.

@jordanpagewhite
Copy link
Collaborator

Hey @robpblake Do you feel that this issue is resolved and/or no longer relevant given the current state of rhd-frontend in the Drupal repo?

@robpblake
Copy link
Collaborator Author

@jordanpagewhite Not resolved and it's still relevant.

Essentially the rhd-frontend package.json should offer a single command e.g: npm run build-drupal-dist which would put all assets required by Drupal into the dist directory in the correct structure e.g:

  • dist/js/rhd-old.min.js
  • dist/css/rhd-old.min.css
  • dist/fonts
  • ...

Then we can update the Dockerfile for Drupal to simply:

cp -r rhd-frontend/dist themes/custom/rhdp2/

as an overlay. This would remove all of the mv and rm commands for building the theme and the only thing that needs to change when a new asset is produced by the rhd-frontend is package.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants