In my project, I have multiple CSS files being generated in the css/
folder using libsass. Additionally, I already have a normalize.css
file placed in the same directory to ensure consistent styling across different browsers. As part of my build process, which is powered by npm, my package.json
includes the following scripts:
{
.....
"scripts": {
"test": "npm run lint",
"lint": "csslint css/*.css",
"build": "node-sass sass/ -o css/",
"postbuild": "cat css/*.css | cleancss -o css/main.min.css"
},
.....
}
During the build step, individual CSS files are generated, and then during the post-build step, they are concatenated into one minified CSS file. However, I am facing an issue where the content of
normalize.css
is not consistently placed at the beginning of the concatenated file as expected. I want to ensure that the normalization styles come before any other CSS rules. Any suggestions on how to achieve this would be greatly appreciated.
Tldr- When concatenating CSS files, normalize.css is sometimes appended in the middle or end instead of the beginning. I need it to be at the start of the concatenated file.
Thank you.