Created
December 12, 2021 21:47
-
-
Save muchirijane/e588cd689bc79c301f01a859355d7f69 to your computer and use it in GitHub Desktop.
Adding sass-gulp for your project.
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
install gulp to your project. | |
npm install sass gulp-sass --save-dev | |
//create a gulpfile.js | |
const { src, dest, watch, series } = require("gulp"); | |
const sass = require("gulp-sass")(require("sass")); | |
function buildStyles() { | |
return src("src/styles/**/*.scss").pipe(sass()).pipe(dest("css/styles")); | |
} | |
function watchStyles() { | |
watch("src/styles/**/*.scss", buildStyles); | |
} | |
exports.default = series(buildStyles, watchStyles); | |
//install package json | |
npm init -y | |
//gitignore | |
# Logs | |
logs | |
*.log | |
npm-debug.log* | |
# Dependency directories | |
node_modules/ | |
# Optional npm cache directory | |
.npm | |
# Optional eslint cache | |
.eslintcache | |
# Optional REPL history | |
.node_repl_history | |
# Stores VSCode versions used for testing VSCode extensions | |
.vscode-test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment