-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Building PostCSS components separately (#1488)
* Building css components separately * Convert to a shell script * Create modern-pets-grab.md * add script folder * Put clean back
- Loading branch information
Showing
5 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@primer/view-components": patch | ||
--- | ||
|
||
Building PostCSS components separately |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
export INPUT_TYPE=$1 | ||
|
||
build_css() { | ||
# Get a list of all the CSS files in the src directory | ||
CSS_FILES=$(find app/components/primer -name '*.pcss' ! -path '*/primer.pcss') | ||
npx postcss $CSS_FILES --dir app/components --base app/components --ext css | ||
# Build main CSS bundle | ||
npx postcss -o app/assets/styles/primer_view_components.css app/components/primer/primer.pcss | ||
} | ||
|
||
# Function to build the assets | ||
build_js() { | ||
# Build the assets | ||
npx tsc | ||
npx rollup -c | ||
} | ||
|
||
if [ "$INPUT_TYPE" = "css" ]; then | ||
echo "Building css assets" | ||
build_css | ||
elif [ "$INPUT_TYPE" = "js" ]; then | ||
# run build_js | ||
echo "Building js assets" | ||
build_js | ||
else | ||
echo "Building all assets" | ||
build_js | ||
build_css | ||
fi |