gulp task not running after latest release
Looks like there is an isssue with hooks. With latest CLI release, gulp task are not running any more. Is there any change/issue related to it? With previous CLI version works fine
Having same issue here.. When doing ionic serve or ionic run browser it ignores tasks from gulp file hooks. So before serve or build it should run tasks 'clean' and 'copy-settings' (see below), but since v2.1.0 it's just ignoring them.
Is this set up allright?
Thanks.
gulp.task('serve:before', ['watch']);
gulp.task('emulate:before', ['build']);
gulp.task('deploy:before', ['build']);
gulp.task('build:before', ['build']);
gulp.task('watch', ['clean', 'copy-settings'], function(done) {
runSequence(
['sass', 'html', 'fonts', 'scripts', 'images', 'polyfillLibs', 'extlibs'],
function() {
gulpWatch('app/**/*.scss', function() {
gulp.start('sass');
});
gulpWatch('app/**/*.html', function() {
gulp.start('html');
});
buildBrowserify({
watch: true
}).on('end', done);
}
);
});
gulp.task('build', ['clean', 'copy-settings'], function(done) {
runSequence(
['sass', 'html', 'fonts', 'scripts', 'images', 'polyfillLibs', 'extlibs'],
function() {
buildBrowserify({
minify: !isDebug,
browserifyOptions: {
debug: isDebug
},
uglifyOptions: {
mangle: false
}
}).on('end', done);
}
);
});
Having same issue here ...
OK, after some trial and error I've found that the issue is on the package.json file.. I have the property "scripts" set package.json like this:
"scripts": {
"test": "karma start karma.conf.js",
"testCI": "karma start karma.conf.CI.js"
}
Which allows me to do npm test or npm testCI for running tests with karma. Is this not supported anymore on v2.1.1? Is it a bug?
Thanks.
With latest update, if the "script" is available on package.json that takes priority over hooks available in gulp. Not sure if this is the intended functionality. Check the code change with this commit, https://github.com/driftyco/ionic-cli/commit/2bc79bf728ef64a9bf66dbbd1224929e1523c1d4
It works this way: if npm script is in package.json cli it is executed with ionic cli and if not cli is executed with gulp.
https://github.com/driftyco/ionic-cli/blob/master/CHANGELOG.md
Yeah, I wonder if this is intended too. Actually I wasn't using "scripts" property as a hook, but rather as a convenience for running them as npm script_name. The CLI should check if there are actually any hooks in the "scripts" property instead of only checking if the property exists.
It would be nice to have both scripts and hooks at the same time, not just one or the other.
Could you provide me with the output from ionic info from within your project directory? Thanks, this should help in troubleshooting.
This is my ionic info:
Cordova CLI: 6.3.1 Gulp version: CLI version 3.9.0 Gulp local: Ionic CLI Version: 2.0.0 Ionic App Lib Version: 2.0.0 OS: Windows 8.1 Node Version: v6.3.1
Could you verify that this is still occurring with the latest CLI release? It sounds as if this was an unintended side effect of recent changes and I want to ensure that it is still an issue. We have made changes recently that should ensure that is does not occur.
@jthoms1 I have recently updated a v1 project to the ionic-cli v.2.4.1 and I am still having this issue. In our package.json file we have a scripts entry similar to @ezekjh above for running our karma tests. This is still causing our local gulpfile.js to be ignored.
Can you reference what changes you are speaking of in your previous comment? It still seems like the update in commit 2bc79bf are what are still causing the "scripts" entry in the package.json to override the local gulpfile.js.
Thanks for the issue! This issue appears to be associated with an old version of the Ionic CLI. Please update to the latest CLI version, which supports all versions of the Ionic Framework. If the issue is relevant and if it persists after updating to the latest CLI version, please create a new issue.
Thank you for using Ionic!