Skip to content

Commit

Permalink
fix(bundler): check if files exist in consolidate styles
Browse files Browse the repository at this point in the history
  • Loading branch information
HeartSquared committed May 29, 2024
1 parent 28f5899 commit f738126
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const pathsToDelete = [
const combineFiles = (): void => {
pathsToCombine.forEach(filePath => {
const file = path.resolve(filePath)
if (fs.statSync(file).isFile()) {
if (fs.existsSync(file) && fs.statSync(file).isFile()) {
const fileContent = fs.readFileSync(file).toString()

fs.appendFileSync(PATH_DIST_STYLES, `${fileContent}\n`)
Expand All @@ -34,7 +34,7 @@ const combineFiles = (): void => {
const deleteFiles = (): void => {
pathsToDelete.forEach(filePath => {
const file = path.resolve(filePath)
if (fs.statSync(file).isFile()) {
if (fs.existsSync(file)) {
fs.unlinkSync(file)
}
})
Expand Down

0 comments on commit f738126

Please sign in to comment.