Last active
July 27, 2020 11:02
-
-
Save shivanarrthine/35e6d0d90f722a61b775a083f891dfba to your computer and use it in GitHub Desktop.
Simple npm setup to compile and post-process Sass files. Use by running `npm run watch-css`
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
{ | |
"scripts": { | |
"build-css": "node-sass --include-path --source-map scss public/sass/application.sass public/css/styles.css", | |
"post-css": "npx postcss public/css/styles.css --config postcss.config.js -o public/css/styles.min.css", | |
"watch-css": "nodemon -e sass -x \"npm run build-css && npm run post-css\"" | |
} | |
} | |
// Node modules required: node-sass, nodemon, postcss-cli, autoprefixer, cssnano | |
// Setup guide: https://www.notion.so/Simple-npm-setup-to-compile-and-post-process-Sass-files-267dd76552de48359718c23b99259864 |
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
module.exports = { | |
plugins: [ | |
require('autoprefixer'), | |
require('cssnano')({ | |
preset: 'default', | |
}), | |
], | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment