You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
821 B
31 lines
821 B
#!/usr/bin/env moshell
|
|
|
|
mkdir -p /outputs/public
|
|
|
|
apt update && apt install jq -y
|
|
npm install
|
|
npm run build -- --base=/IQBall/public --mode PROD
|
|
|
|
// Read generated mappings from build
|
|
val result = $(jq -r 'to_entries|map(.key + " " +.value.file)|.[]' dist/manifest.json)
|
|
val mappings = $result.split('\n')
|
|
|
|
|
|
echo '<?php\nconst ASSETS = [' > views-mappings.php
|
|
|
|
while $mappings.len() > 0 {
|
|
val mapping = $mappings.pop().unwrap();
|
|
val mapping = $mapping.split(' ');
|
|
val source_file = $mapping[0]
|
|
val build_file = $mapping[1]
|
|
echo "\t'$source_file' => '$build_file'," >> views-mappings.php
|
|
}
|
|
|
|
echo "];" >> views-mappings.php
|
|
|
|
chmod +r views-mappings.php
|
|
|
|
// moshell does not supports file patterns
|
|
bash <<< "mv dist/* public/* front/assets/ front/style/ /outputs/public/"
|
|
mv views-mappings.php /outputs/
|