Skip to content

Commit

Permalink
fix: prevent process exit when no SCSS files are found
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarmarina committed Nov 28, 2024
1 parent 07305eb commit 03a38c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,15 @@ export class SassStyleTemplate {
* Initializes the SASS style template processing.
*/
init() {
const globFiles = this.globFiles && this.globFiles.length > 0 ? this.globFiles : [];
const hasGlobFiles = this.globFiles && this.globFiles.length > 0;
const globFiles = hasGlobFiles ? this.globFiles : [` `];

if (!hasGlobFiles) {
console.info(
`${color.BrightCyan}[sass]${color.grey} No SASS files found to process. ${color.reset}`
);
}

this.watchSass(globFiles);
this.globSassFile(this.renderStylesTemplate);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@blockquote/sass-style-template",
"version": "4.0.2",
"version": "4.0.3",
"description": "A SCSS watcher with autoprefixer for building Web Components using Lit and SASS.",
"keywords": [
"lit",
Expand Down

0 comments on commit 03a38c1

Please sign in to comment.