SASS no longer compiles (looks) when using the function after updating Ionic

I recently updated ionic and its libraries, but that changed a lot of things for me.

Now I can make some changes to the HTML, and my current download just shows them. When I do this in a specific SCSS file, nothing happens at all. Therefore, the team ionic serve --labis useless to me.

This is my gulpfile.js

var gulp = require('gulp');
var gutil = require('gulp-util');
var bower = require('bower');
var concat = require('gulp-concat');
var sass = require('gulp-sass');
var minifyCss = require('gulp-minify-css');
var rename = require('gulp-rename');
var sh = require('shelljs');

var paths = {
  sass: ['./scss/**/*.scss']
};

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

gulp.task('sass', function(done) {
  gulp.src('./scss/ionic.app.scss')
    .pipe(sass())
    .on('error', sass.logError)
    .pipe(gulp.dest('./www/css/'))
    .pipe(minifyCss({
      keepSpecialComments: 0
    }))
    .pipe(rename({ extname: '.min.css' }))
    .pipe(gulp.dest('./www/css/'))
    .on('end', done);
});

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

And this is my local environment:

Cordova CLI: You have been opted out of telemetry. To change this, run: cordova telemetry on.
6.3.1

Gulp version:  CLI version 3.9.1
Gulp local:   Local version 3.9.1
Ionic Framework Version: 1.3.1-nightly-4219
Ionic CLI Version: 2.1.0-beta.3
Ionic App Lib Version: 2.1.0-beta.1
ios-deploy version: 1.9.0 
ios-sim version: 5.0.8 
OS: Mac OS X El Capitan
Node Version: v6.6.0
Xcode version: Xcode 8.0 Build version 8A218a 

Any idea what will go wrong or what should I do? I already tried ionic setup sass, but this only works once. I do not want every time I change the code. It looks like he no longer looks at my SCSS file, but I don’t know why, because I didn’t change mine at all gulpfile.js.

+4
2

, , , 1.x 2.x .

, :

gulpfile.js

gulp.task('serve:before', ['default','watch']);

ionic.config.js :

{
  "name": "HereComesTheNameOfYourApp",
  "app_id": "YOURIDNUMBERHERE",
  "v2": false,
  "typescript": false,
  "watch": {
    "sass": [
      "scss/**/*.scss"
    ],
    "html": [
      "www/**/*.html"
    ],
    "livereload": [
      "www/**/*.html",
      "www/**/*.js",
      "www/**/*.css"
    ]
  }
}

, - .

+8

Ionic, :

  • ionic run serve
  • gulp sass
0

Source: https://habr.com/ru/post/1657254/


All Articles