Add specific theme build support
This commit is contained in:
parent
09ec60e42d
commit
7677c09237
|
@ -25,10 +25,14 @@ The following instructions explain how to get, build and run the latest Engelsys
|
||||||
```
|
```
|
||||||
to install the Engelsystem
|
to install the Engelsystem
|
||||||
* Build the frontend assets
|
* Build the frontend assets
|
||||||
|
* All
|
||||||
```bash
|
```bash
|
||||||
yarn build
|
yarn build
|
||||||
```
|
```
|
||||||
* Optionally (for better performance)
|
* Specific themes only by providing the `THEMES` environment variable, e.g.
|
||||||
|
```bash
|
||||||
|
THEMES=0,1 yarn build
|
||||||
|
```
|
||||||
* Generate translation files
|
* Generate translation files
|
||||||
```bash
|
```bash
|
||||||
find resources/lang/ -type f -name '*.po' -exec sh -c 'file="{}"; msgfmt "${file%.*}.po" -o "${file%.*}.mo"' \;
|
find resources/lang/ -type f -name '*.po' -exec sh -c 'file="{}"; msgfmt "${file%.*}.po" -o "${file%.*}.mo"' \;
|
||||||
|
@ -128,9 +132,12 @@ docker-compose exec es_workspace composer i
|
||||||
# Install node packages
|
# Install node packages
|
||||||
docker-compose exec es_workspace yarn install
|
docker-compose exec es_workspace yarn install
|
||||||
|
|
||||||
# Run a front-end build
|
# Run a full front-end build
|
||||||
docker-compose exec es_workspace yarn build
|
docker-compose exec es_workspace yarn build
|
||||||
|
|
||||||
|
# Or run a front-end build for specific themes only, e.g.
|
||||||
|
docker-compose exec -e THEMES=0,1 es_workspace yarn build
|
||||||
|
|
||||||
# Update the translation files
|
# Update the translation files
|
||||||
docker-compose exec es_workspace find /var/www/resources/lang -type f -name '*.po' -exec sh -c 'file="{}"; msgfmt "${file%.*}.po" -o "${file%.*}.mo"' \;
|
docker-compose exec es_workspace find /var/www/resources/lang -type f -name '*.po' -exec sh -c 'file="{}"; msgfmt "${file%.*}.po" -o "${file%.*}.mo"' \;
|
||||||
|
|
||||||
|
@ -141,8 +148,11 @@ docker-compose exec es_workspace bin/migrate
|
||||||
While developing you may use the watch mode to rebuild the system on changes
|
While developing you may use the watch mode to rebuild the system on changes
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Run a front-end build
|
# Run a front-end build and update on change
|
||||||
docker-compose exec es_workspace yarn build:watch
|
docker-compose exec es_workspace yarn build:watch
|
||||||
|
|
||||||
|
# Or run a front-end build and update on change for specific themes only, e.g.
|
||||||
|
docker-compose exec -e THEMES=0,1 es_workspace yarn build:watch
|
||||||
```
|
```
|
||||||
|
|
||||||
**Hint for using Xdebug with *PhpStorm***
|
**Hint for using Xdebug with *PhpStorm***
|
||||||
|
|
|
@ -23,7 +23,12 @@ const plugins = [
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
|
|
||||||
const themeFileNameRegex = /theme\d+/;
|
let themeFileNameRegex = /theme\d+/;
|
||||||
|
|
||||||
|
if (process.env.THEMES) {
|
||||||
|
themeFileNameRegex = new RegExp(`theme(${process.env.THEMES.replace(/,/g, '|')})\\.`);
|
||||||
|
}
|
||||||
|
|
||||||
const themePath = path.resolve('resources/assets/themes');
|
const themePath = path.resolve('resources/assets/themes');
|
||||||
const themeEntries = fs
|
const themeEntries = fs
|
||||||
.readdirSync(themePath)
|
.readdirSync(themePath)
|
||||||
|
|
Loading…
Reference in New Issue