gulp-sass

Gulp SASS Sourcemap sources are incorrect

旧时模样 提交于 2019-12-04 11:07:21
I am struggling to get my SASS sourcemaps to work correctly. The problem seems to be the "sources" attribute within the sourcemap and how my SASS files are nested. I have a Gulp task that compiles SASS to CSS. Here is an example of that var paths = { styles: { src: './Stylesheets/SCSS/', files: './Stylesheets/SCSS/**/*.scss', dest: './Stylesheets/CSS/' } } gulp.task('compile-sass', function (){ return gulp.src(paths.styles.files) .pipe(sourcemaps.init()) .pipe(sass({ outputStyle: 'compressed', includePaths : [paths.styles.src] })) .pipe(prefix({ browsers: ['last 2 Chrome versions'], cascade:

Gulp: only compile changed files AND compile parents when imported SCSS file is edited

时间秒杀一切 提交于 2019-12-03 20:45:22
At work we used to use Ruby to compile SCSS. I had the Ruby compiler set up as a file watcher in PhpStorm, and when I edited a partial imported by another file, the CSS file corresponding to the ancestor file was updated without any fuss. I want to get Gulp and Libsass to work the same way. Most solutions I've seen just compile all the SCSS files in a project when a single one changes, but our projects have way too much SCSS for that to be an acceptable solution. gulp-cached seemed like a great solution to this problem. But when I use gulp-cached the CSS output file doesn't change when I edit

Gulp.js event stream merge order

扶醉桌前 提交于 2019-12-02 16:15:46
I am trying to merge css and scss files into a main.css file that goes in my build directory. Its working, but not in the right order. The style attributes from the scss files need to be in the bottom of the main.css file so they overrule the rest. my Gulp task looks like this: //CSS gulp.task('css', function () { var cssTomincss = gulp.src(['dev/css/reset.css', 'dev/css/style.css','dev/css/typography.css', 'dev/css/sizes.css']); var cssFromscss = gulp.src(['dev/css/*.scss']) .pipe(sass()); return es.merge(cssTomincss, cssFromscss) .pipe(concat('main.css')) .pipe(minifyCSS()) .pipe(gulp.dest(

Gulp-sass will not compile to CSS

纵然是瞬间 提交于 2019-12-02 13:42:53
问题 I'm not able to get grunt-sass to compile to .css. Have seen a load of other similar posts and utilized suggestions but nothing seems to work. I can get other plugins working fine (for example 'del' to delete stuff, shown here) so it seems my environment is ok, and i can get ordinary vanilla sass compile/watch to work fine. Here's my setup just in case: OSX Maverics 10.9.5 $ ruby -v ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin13] $ sass -v Sass 3.4.9 (Selective Steve) $

Gulp watch all files but render only one (sass)

最后都变了- 提交于 2019-12-01 17:31:07
问题 I want to make gulp watch for all changes on my work folders but to generate only one file. Because I use scss which imports all required files, there is no need to compile all .css files, only main one. Now, my gulpfile.js contains: var gulp = require('gulp'); var util = require('gulp-util'); var sass = require('gulp-sass'); gulp.task('sass', function () { return gulp.src('./sass/style.scss') .pipe(sass().on('error', sass.logError)) .pipe(gulp.dest('./dist/css')); }); gulp.task('watch',

Gulp can't seem to find compass mixins

时间秒杀一切 提交于 2019-12-01 12:27:15
I am trying out gulp as an alternative build tool to Grunt, to compile my scss to css, as I have heard it can be much faster. I having problems doing even a basic compile of my scss files. I have tried using the gulp-sass , gulp-ruby-sass and gulp-compass plugins for gulp and I get pretty much the same error message every time: error screen.scss (Line 2 of _grid.scss: Undefined mixin 'box-sizing'.) So it looks like it is falling down as soon as it hits a compass mixin. I have ruby installed on my PC with compass version 1.0.0.alpha.19 and sass version 3.3.7. Here is my gulpfile: var gulp =

Gulpjs combine two tasks into a single task

自闭症网瘾萝莉.ら 提交于 2019-11-29 21:14:44
I currently have two tasks, that both compile sass files. I would still like to concat the two directories into separate files but it seems that it would be more maintainable if I could simply create a 'sass' task that would be responsible for all of the sass compilation. // Compile Our Sass gulp.task('bootstrap-sass', function() { return gulp.src('./public/bower/bootstrap-sass/lib/*.scss') .pipe(sass()) .pipe(contact('bootstrap.css')) .pipe(gulp.dest('./public/dist/css')); }); gulp.task('site-sass', function() { return gulp.src('./public/app/scss/*.scss') .pipe(sass()) .pipe(contact('site.css

node sass release 3.5.3 is breaking build

£可爱£侵袭症+ 提交于 2019-11-29 14:46:15
This is also currently biting my project, which uses gulp-sass. gulp-sass depends on node-sass#^3.4.1 which just automatically updated to 3.5.3 which is a breaking release. I have degraded my gulp sass version to the older(2.1.0) by updating the package.json file but its still breaking. how to go back to node sass 3.4.2? Error Message Error: You may not @extend an outer selector from within @media. You may only @extend selectors within the same directive. { "version": "1.0.0", "name": "abcd", "devDependencies": { "bower": "^1.3.12", "express": "^4.12.3", "gulp": "^3.8.10", "gulp-autoprefixer":

Gulp 4 - Gulpfile.js set up

天涯浪子 提交于 2019-11-28 21:41:33
问题 I'm finding documentation on Gulp 4 extremely hard to find so I thought I might ask here to see if anyone can help. I'm pretty new to Gulp anyway and have been using Gulp 3 without any problems until I tried running it on a virtual machine we use for development. My gulp file is very straight forward I just use gulp-sass to compile SASS to a css file which was working fine but every time it saves the css file it changes the write permissions on the file and the browser can't read the file! So

How to fix ReferenceError: primordials is not defined in node

久未见 提交于 2019-11-28 18:05:08
I have installed node modules by npm install, then I tried to do gulp sass-watch in command prompt. After that I got the below response. [18:18:32] Requiring external module babel-register fs.js:27 const { Math, Object, Reflect } = primordials; ^ ReferenceError: primordials is not defined Have tried this before gulp sass-watch npm -g install gulp-cli Hassan Hodges I hit the same error. I suspect you're using node 12 and gulp 3. That combination does not work: https://github.com/gulpjs/gulp/issues/2324 A previous workaround from Jan. does not work either: https://github.com/gulpjs/gulp/issues