Closed 1BJK903 closed 8 years ago
This is my gulpfile.js by the way:
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']);
});
Okay, I've found the solution, but it's actually very sad that the transition between ionic 1.x and ionic 2.x is just so badly documentated and not working flawlessly.
Anyway, what I did is:
Add this to my gulpfile.js
gulp.task('serve:before', ['default','watch']);
And also change my ionic.config.js
file to:
{
"name": "HereComesTheNameOfYourApp",
"app_id": "YOURIDNUMBERHERE",
"v2": false,
"typescript": false,
"watch": {
"sass": [
"scss/**/*.scss"
],
"html": [
"www/**/*.html"
],
"livereload": [
"www/**/*.html",
"www/**/*.js",
"www/**/*.css"
]
}
}
Hope it will help someone else as well.
Has ionic 2 gulp file? Please explain where is gulpfile.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Hi guys,
Question: my ionic serve --lab function doesn't work properly anymore. If I'd remove any SCSS file, it doesn't reload my page at all... when I reload it manually, the whole page stays there, without changing the style, while it should be blank because I have no SCSS file anymore...
The thing is: it watches any HTML change I make and reloads it...
My question is: how can I fix this?
I recently updated Ionic, maybe that's the problem?
It just looks like he isn't watching the SCSS anymore. Can someone help me out please?