I'm creating a task that compiles, renames, and simplifies files .scss
to .css
. My file structure looks like this:
assets/
|__ css/
|__ sass/
| |__ uma-pasta/
| | |__ alguns.scss
| | |__ arquivos.scss
| | |__ vão.scss
| | |__ aqui.scss
| |__ outra-pasta/
| |__ alguns.scss
| |__ outros.scss
| |__ arquivos.scss
| |__ vão.scss
| |__ aqui.scss
|__ _variables.scss
But when I run the following task:
gulp.task('sass', function() {
gulp.src(['!assets/sass/outra-pasta/**/*.scss', 'assets/sass/**/*.scss'])
.pipe(sass().on('error', sass.logError))
.pipe(rename({ suffix: '.min' }))
.pipe(minify())
.pipe(gulp.dest(PATH + 'assets/css'))
});
The variables located in assets/sass/_variables.scss
are not concatenated with the other files, and then I get the following error:
Error in plugin 'sass'
Message:
assets/sass/uma-pasta/arquivos.scss
Error: Undefined variable: "$variable".
on line 3 of stdin
>> width: $variable;
--------^
And the file assets/sass/_variables.scss
looks like this:
$variable: 20px;