-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
33 additions
and
7,112 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,30 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
// Directory containing individual CSS files | ||
const cssDirectory = path.join(__dirname, './assets/css/*.min.css'); | ||
|
||
// Output file where the combined CSS will be saved | ||
const outputFilePath = path.join(__dirname, './assets/combined.css'); | ||
|
||
// Read all CSS files in the cssDirectory and concatenate their content | ||
fs.readdir(cssDirectory, (err, files) => { | ||
if (err) { | ||
console.error('Error reading CSS files:', err); | ||
return; | ||
} | ||
|
||
const cssContent = files | ||
.filter(file => path.extname(file) === '.css') | ||
.map(file => fs.readFileSync(path.join(cssDirectory, file), 'utf8')) | ||
.join('\n'); | ||
|
||
// Write the combined CSS content to the output file | ||
fs.writeFile(outputFilePath, cssContent, err => { | ||
if (err) { | ||
console.error('Error writing combined CSS file:', err); | ||
return; | ||
} | ||
console.log('CSS files combined successfully!'); | ||
}); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.