shwstppr commented on pull request #5406:
URL: https://github.com/apache/cloudstack/pull/5406#issuecomment-914154782
> cc @utchoang @davidjumani @Pearl1594 @shwstppr
> Do we really need this, or can we get less to bundle on build time? And
does this apply for 4.15.2?
@rhtyd could be done using pre/post build scripts but I'm not sure if that
would add any value,
```
diff --git a/ui/postbuild.sh b/ui/postbuild.sh
index ab7734f383..72c25c8a4e 100755
--- a/ui/postbuild.sh
+++ b/ui/postbuild.sh
@@ -19,6 +19,16 @@
DIR=$(dirname $0)
configFile="$DIR/public/config.json"
tmpFile="$DIR/public/config.json.tmp"
+jsDir="$DIR/public/js"
+lessJsFile="$jsDir/less.min.js"
+echo "Post-build: Removing ${lessJsFile}"
+if [ -f $lessJsFile ]; then
+ rm $lessJsFile
+fi
+if ! rmdir $jsDir 2> /dev/null; then
+ echo "$jsDir contains the following files:"
+ ls $jsDir
+fi
echo "Post-build: removing all docHelp suffixes in ${configFile}"
node > ${tmpFile} <<EOF
diff --git a/ui/prebuild.sh b/ui/prebuild.sh
index 771daa84b2..00cd611906 100755
--- a/ui/prebuild.sh
+++ b/ui/prebuild.sh
@@ -19,6 +19,15 @@
DIR=$(dirname $0)
configFile="$DIR/public/config.json"
tmpFile="$DIR/public/config.json.tmp"
+jsDir="$DIR/public/js"
+lessJsFile="$jsDir/less.min.js"
+lessJsUrl="https://cdnjs.cloudflare.com/ajax/libs/less.js/2.7.2/less.min.js"
+echo "Pre-build: Creating ${lessJsFile}"
+if [ ! -d $jsDir ]; then
+ mkdir $jsDir
+fi
+wget -O $lessJsFile $lessJsUrl
+
echo "Pre-build: list all docHelp suffixes in ${configFile}"
for m in $(grep "docHelp: '" -R ./src | sed "s/^.*: '//g" | sed "s/',//g" |
sort | uniq); do
docHelpMappings+="${m},"
diff --git a/ui/theme.config.js b/ui/theme.config.js
index 8a41c49b5c..6bdd891bc7 100644
--- a/ui/theme.config.js
+++ b/ui/theme.config.js
@@ -50,6 +50,7 @@ const options = {
],
indexFileName: 'index.html',
publicPath: '.',
+ lessUrl: 'js/less.min.js',
generateOnce: false
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]