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

[KOB-39433] Fix bug scripts minify css. #200

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions scripts/minify-css.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,16 @@ OS_ARCH=$(uname)
echo "Image architecture: $OS_ARCH"

# Merge all css files to 1 file excluding site.css.
find "$PROJECT_ROOT"/ui-bundle-docs/css/ -type f -not -name 'site.css' -name '*.css' \
-exec cat {} \; | \
npx postcss --use postcss-import postcss-clean --no-map > "$TEMP_FILE_DOCS"
find "$PROJECT_ROOT"/ui-bundle-widget/css/ -type f -not -name 'site.css' -name '*.css' \
-exec cat {} \; | \
npx postcss --use postcss-import postcss-clean --no-map > "$TEMP_FILE_WIDGET"
find $PROJECT_ROOT/ui-bundle-docs/css/ -type f -not -name 'site.css' -name '*.css' -exec cat {} \; | npx postcss --use postcss-import postcss-clean --no-map > "$TEMP_FILE_DOCS"
find $PROJECT_ROOT/ui-bundle-widget/css/ -type f -not -name 'site.css' -name '*.css' -exec cat {} \; | npx postcss --use postcss-import postcss-clean --no-map > "$TEMP_FILE_WIDGET"

# Remove all comments from the merged files (anything between /* and */).
if [[ "$OS_ARCH" == "Linux" ]]; then
sed -i 's/\/\*.*\*\///g' "$TEMP_FILE_DOCS"
sed -i 's/\/\*.*\*\///g' "$TEMP_FILE_WIDGET"
else
sed -i '' 's/\/\*.*\*\///g' "$TEMP_FILE_DOCS"
sed -i '' 's/\/\*.*\*\///g' "$TEMP_FILE_WIDGET"
else
sed -i 's/\/\*.*\*\///g' "$TEMP_FILE_DOCS"
sed -i 's/\/\*.*\*\///g' "$TEMP_FILE_WIDGET"
fi

# Append the header comment.
Expand Down
Loading