Understanding Compilation Errors in gulp-sass

Asked 1 years ago, Updated 1 years ago, 80 views

When compiling the Pass file using gulp-ass,

 through /glaptest ggulp pass
[15:46:37] Using gulpfile~/Desktop/glaptest/gulpfile.js
[15:46:37] Starting 'sass'...
Error in plugin'sass'
Message:
    node_modules/sass-graph/test/fixes/d.scss
Error: File to import not found or unreliable:e
       Parent style sheet: stdin
        online1 of stdin
>>@import "e";
  ^

An error similar to this appears.
node_modules/sass-graph/test/fixes/d.scssis

@import "e";

is described as
Certainly, there is no e.scss in node_modules/ass-graph/test/fixes.
What should I do?

Also, gulp-ass is

 sudonpm install gulp-sass --save-dev

I installed it in .

Also, gulofile.js wrote as follows

'use strict';

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

gulp.task('ass', function(){
  return gulp.src('./**/*.scss')
    .pipe(ass().on('error',ass.logError')
    .pipe(gulp.dest('./'));
});

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

Run Environment

  • OS X 10.11.3
  • node.js v5.7.0
  • npm 3.7.5
  • gulp CLI version 3.9.1, Local version 3.9.1

gulp

2022-09-30 15:36

1 Answers

gulp.src('./**/*.scss')

This document compiles all scss files below the current directory.As a result, the test files for Node modules installed in ./node_modules/ are compiled as well.

If you want to compile files from your project, such as gulp-ass, etc., place the scss file in a specific directory and compile them only for that directory.For example...

.
|-- src// Compiled from
| `--css
|   |--main.scss
|   |--sub.scss
|   `-- ...
`-- dest // Compiled to
  `-- css
    |-- main.css
    |-- sub.css
    `-- ...

In this structure,

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

and so on.In this case ./src/css/ Compile all of the following scss files and print them out below ./dest/css/.


2022-09-30 15:36

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.