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

#356 - Document how to use npm to build the theme within DDEV #358

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .ddev/commands/web/npm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
## Description: Run npm commands inside theme.
## Usage: npm [flags] [args]
## Example: "npm install or npm rebuild node-sass or npm run build or npm run watch"
cd /var/www/html/web/themes/custom/contribtracker && npm $@
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. I am not sure about this because I recently found out that DDEV handles this by translating the host path into a guest path when running ddev commands. This means that if we switch to the theme directory and run ddev npm, it would work fine. I am wondering if that is more intuitive than this approach. What do you think?

See ddev/ddev#3747 (comment)

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ The following tools are required for setting up the site. Ensure you are using t
- [Docker](https://docs.docker.com/install/) or [OrbStack](https://orbstack.dev/)
- [DDEV](https://ddev.com/get-started/) - v1.22.0
- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) - v2.17.1
- [NodeJs](https://nodejs.org/en/download)

*Note*: Ensure you have sufficient RAM (ideally 16 GB, minimum 8 GB)

Expand Down Expand Up @@ -77,7 +76,7 @@ ddev drush cr
### Theme Build

```bash
cd web/themes/custom/contribtracker && npm install && npm run build && ddev drush cr
ddev npm install && ddev npm run build && ddev drush cr
```

You can access the site at: [https://contribtracker.ddev.site/](https://contribtracker.ddev.site/).
Expand Down