Gulp command does not work

0

Hello,

I created a home.sass file

@import molecules/mixins

@import ../bower_components/bootstrap-sass/assets/stylesheets/bootstrap /variables
@import ../bower_components/bootstrap-sass/assets/stylesheets/bootstrap /mixins
@import ../bower_components/breakpoint-sass/stylesheets/breakpoint'

These lines were to import these files into my css folder but when I give the gulp command, the files are not imported it reads my gulpfile and then nothing else appears in the terminal and I always have to terminate the command by giving ctrl + C

C:\Users\loja\Desktop\Alacarte>gulp
[15:41:46] Using gulpfile ~\Desktop\Alacarte\gulpfile.js
[15:41:46] Starting 'sass'...
[15:41:46] Starting 'watch'...
[15:41:47] Finished 'watch' after 210 ms
[15:41:48] Finished 'sass' after 1.92 s
[15:41:48] Starting 'default'...
[15:41:48] Finished 'default' after 22 μs 

This is my gulpfile

'use strict';

var gulp = require('gulp');
var sass = require('gulp-sass');
var watch = require('gulp-watch');

gulp.task('default', ['sass', 'watch']);

var gulp = require('gulp');
var sass = require('gulp-sass');

gulp.task('sass', function () {
 return gulp.src('sass/**/*.sass')
    .pipe(sass({outputStyle: 'compressed'}))
    .pipe(sass().on('error', sass.logError))
    .pipe(gulp.dest('css'));
});

gulp.task('watch', function () {
gulp.watch('sass/**/*.sass', ['sass']);
});

Can you help me?

    
asked by anonymous 23.05.2017 / 20:56

1 answer

1

Let's get some data, your @import files are being called the wrong way, missing the * extension and missing the url with simple 'quotes'.

* Mentioned that the extension is missing because I do not know how your files are named if your files are named with _ underline at the beginning of the file name _meu-scss.scss It's fine to call them without the extension.

  

How to import to url

@import '<nome-da-pasta>/<nome-arquivo><.><extensão-do-arquivo>';

Changing your code to the correct format will look like this

@import 'molecules/mixins.sass';
@import '../bower_components/bootstrap-sass/assets/stylesheets/bootstrap /variables.sass';
@import '../bower_components/bootstrap-sass/assets/stylesheets/bootstrap /mixins.sass;'
@import '../bower_components/breakpoint-sass/stylesheets/breakpoint.sass';

In the gulpfile.js file you need to confirm the url of the folder you want to monitor.

gulp.watch('sass/**/*.sass',['sass]);

How to pass url would thus be inserting the path from the ./ of the home directory.

gulp.watch('./sass/**/*.sass',['sass]);
    
30.10.2017 / 17:01