mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 12:33:26 +00:00
add gulp watch for js files
This commit is contained in:
@@ -12,14 +12,22 @@ gulp.task('build-account-css', function(){
|
|||||||
], 'account', 'account/css/');
|
], 'account', 'account/css/');
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('watch-account', function() {
|
gulp.task('build-account-js', function(){
|
||||||
gulp.watch(config.paths.src + 'account/**/*.scss', ['build-account-css']);
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('build-account', ['copy-account-images', 'build-account-css'], function(){
|
|
||||||
var accountGroup = [
|
var accountGroup = [
|
||||||
config.paths.vendors + 'requirejs/require.js',
|
config.paths.vendors + 'requirejs/require.js',
|
||||||
config.paths.src + 'account/js/account.js'
|
config.paths.src + 'account/js/account.js'
|
||||||
];
|
];
|
||||||
return utils.buildJsGroup(accountGroup, 'account', 'account/js');
|
return utils.buildJsGroup(accountGroup, 'account', 'account/js');
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('watch-account-js', function() {
|
||||||
|
return gulp.watch(config.paths.src + 'account/**/*.js', ['build-account-js']);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('watch-account-css', function() {
|
||||||
|
gulp.watch(config.paths.src + 'account/**/*.scss', ['build-account-css']);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('build-account', ['copy-account-images', 'build-account-css'], function(){
|
||||||
|
return gulp.start('build-account-js');
|
||||||
});
|
});
|
@@ -12,11 +12,7 @@ gulp.task('build-admin-css', function(){
|
|||||||
], 'admin', 'admin/css/');
|
], 'admin', 'admin/css/');
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('watch-admin', function() {
|
gulp.task('build-admin-js', function(){
|
||||||
gulp.watch(config.paths.src + 'admin/**/*.scss', ['build-admin-css']);
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('build-admin', ['copy-admin-images', 'build-admin-css'], function(){
|
|
||||||
var adminGroup = [
|
var adminGroup = [
|
||||||
config.paths.vendors + 'underscore-amd/underscore.js',
|
config.paths.vendors + 'underscore-amd/underscore.js',
|
||||||
config.paths.vendors + 'jquery-treeview/jquery.treeview.js',
|
config.paths.vendors + 'jquery-treeview/jquery.treeview.js',
|
||||||
@@ -27,4 +23,16 @@ gulp.task('build-admin', ['copy-admin-images', 'build-admin-css'], function(){
|
|||||||
config.paths.dist + 'scripts/apps/admin/main/main.js'
|
config.paths.dist + 'scripts/apps/admin/main/main.js'
|
||||||
];
|
];
|
||||||
utils.buildJsGroup(adminGroup, 'admin', 'admin/js');
|
utils.buildJsGroup(adminGroup, 'admin', 'admin/js');
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('watch-admin-js', function() {
|
||||||
|
return gulp.watch(config.paths.src + 'admin/**/*.js', ['build-admin-js']);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('watch-admin-css', function() {
|
||||||
|
gulp.watch(config.paths.src + 'admin/**/*.scss', ['build-admin-css']);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('build-admin', ['copy-admin-images', 'build-admin-css'], function(){
|
||||||
|
return gulp.start('build-admin-js');
|
||||||
});
|
});
|
@@ -12,14 +12,22 @@ gulp.task('build-authentication-css', function(){
|
|||||||
], 'authentication', 'authentication/css/');
|
], 'authentication', 'authentication/css/');
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('watch-authentication', function() {
|
gulp.task('build-authentication-js', function(){
|
||||||
gulp.watch(config.paths.src + 'authentication/**/*.scss', ['build-authentication-css']);
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('build-authentication', ['copy-authentication-images', 'build-authentication-css'], function(){
|
|
||||||
var authenticationGroup = [
|
var authenticationGroup = [
|
||||||
config.paths.vendors + 'requirejs/require.js',
|
config.paths.vendors + 'requirejs/require.js',
|
||||||
config.paths.dist + 'scripts/apps/login/home/config.js'
|
config.paths.dist + 'scripts/apps/login/home/config.js'
|
||||||
];
|
];
|
||||||
return utils.buildJsGroup(authenticationGroup, 'authentication', 'authentication/js');
|
return utils.buildJsGroup(authenticationGroup, 'authentication', 'authentication/js');
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('watch-authentication-js', function() {
|
||||||
|
return gulp.watch(config.paths.src + 'authentication/**/*.js', ['build-authentication-js']);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('watch-authentication-css', function() {
|
||||||
|
gulp.watch(config.paths.src + 'authentication/**/*.scss', ['build-authentication-css']);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('build-authentication', ['copy-authentication-images', 'build-authentication-css'], function(){
|
||||||
|
return gulp.start('build-authentication-js');
|
||||||
});
|
});
|
@@ -23,11 +23,7 @@ gulp.task('build-common-css', ['build-common-font-css'],function(){
|
|||||||
], 'common', 'common/css/')
|
], 'common', 'common/css/')
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('watch-common', function() {
|
gulp.task('build-common-js', function(){
|
||||||
gulp.watch(config.paths.src + 'common/**/*.scss', ['build-common-css']);
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('build-common', ['copy-common-images', 'build-common-css'], function(){
|
|
||||||
var commonGroup = [
|
var commonGroup = [
|
||||||
// config.paths.dist + 'assets/bootstrap/js/bootstrap.js', // should append no conflict
|
// config.paths.dist + 'assets/bootstrap/js/bootstrap.js', // should append no conflict
|
||||||
config.paths.src + 'vendors/jquery-mousewheel/js/jquery.mousewheel.js',
|
config.paths.src + 'vendors/jquery-mousewheel/js/jquery.mousewheel.js',
|
||||||
@@ -47,4 +43,16 @@ gulp.task('build-common', ['copy-common-images', 'build-common-css'], function()
|
|||||||
config.paths.dist + 'include/jslibs/flowplayer/flowplayer-3.2.13.min.js' // @TODO: should be moved away (embed-bundle)
|
config.paths.dist + 'include/jslibs/flowplayer/flowplayer-3.2.13.min.js' // @TODO: should be moved away (embed-bundle)
|
||||||
];
|
];
|
||||||
return utils.buildJsGroup(commonGroup, 'common', 'common/js');
|
return utils.buildJsGroup(commonGroup, 'common', 'common/js');
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('watch-common-js', function() {
|
||||||
|
return gulp.watch(config.paths.src + 'common/**/*.js', ['build-common-js']);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('watch-common-css', function() {
|
||||||
|
gulp.watch(config.paths.src + 'common/**/*.scss', ['build-common-css']);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('build-common', ['copy-common-images', 'build-common-css'], function(){
|
||||||
|
return gulp.start('build-common-js');
|
||||||
});
|
});
|
@@ -32,11 +32,7 @@ gulp.task('build-lightbox-css', ['build-lightbox-mobile-css', 'build-lightbox-ie
|
|||||||
], 'lightbox', 'lightbox/css/')
|
], 'lightbox', 'lightbox/css/')
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('watch-lightbox', function() {
|
gulp.task('build-lightbox-js', ['build-lightbox-mobile-js'], function(){
|
||||||
gulp.watch(config.paths.src + 'lightbox/**/*.scss', ['build-lightbox-css']);
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('build-lightbox', ['copy-lightbox-images', 'build-lightbox-css', 'build-lightbox-mobile-js'], function(){
|
|
||||||
var lightboxGroup = [
|
var lightboxGroup = [
|
||||||
config.paths.src + 'lightbox/js/jquery.lightbox.js'
|
config.paths.src + 'lightbox/js/jquery.lightbox.js'
|
||||||
];
|
];
|
||||||
@@ -46,4 +42,16 @@ gulp.task('build-lightbox', ['copy-lightbox-images', 'build-lightbox-css', 'buil
|
|||||||
];
|
];
|
||||||
utils.buildJsGroup(lightboxIE6Group, 'lightboxIe6', 'lightbox/js');
|
utils.buildJsGroup(lightboxIE6Group, 'lightboxIe6', 'lightbox/js');
|
||||||
return utils.buildJsGroup(lightboxGroup, 'lightbox', 'lightbox/js');
|
return utils.buildJsGroup(lightboxGroup, 'lightbox', 'lightbox/js');
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('watch-lightbox-js', function() {
|
||||||
|
return gulp.watch(config.paths.src + 'lightbox/**/*.js', ['build-lightbox-js']);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('watch-lightbox-css', function() {
|
||||||
|
gulp.watch(config.paths.src + 'lightbox/**/*.scss', ['build-lightbox-css']);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('build-lightbox', ['copy-lightbox-images', 'build-lightbox-css'], function(){
|
||||||
|
return gulp.start('build-lightbox-js');
|
||||||
});
|
});
|
@@ -2,7 +2,7 @@ var gulp = require('gulp');
|
|||||||
var config = require('../config.js');
|
var config = require('../config.js');
|
||||||
var utils = require('../utils.js');
|
var utils = require('../utils.js');
|
||||||
|
|
||||||
gulp.task('watch-oauth', function() {
|
gulp.task('watch-oauth-css', function() {
|
||||||
gulp.watch(config.paths.src + 'oauth/**/*.scss', ['build-oauth']);
|
gulp.watch(config.paths.src + 'oauth/**/*.scss', ['build-oauth']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -59,12 +59,7 @@ gulp.task('build-prod-css', ['build-prod-skin-black', 'build-prod-skin-grey'], f
|
|||||||
config.paths.src + 'prod/styles/main.scss'
|
config.paths.src + 'prod/styles/main.scss'
|
||||||
], 'prod', 'prod/css/');
|
], 'prod', 'prod/css/');
|
||||||
});
|
});
|
||||||
|
gulp.task('build-prod-js', function(){
|
||||||
gulp.task('watch-prod', function() {
|
|
||||||
return gulp.watch(config.paths.src + 'prod/**/*.scss', ['build-prod-css']);
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('build-prod', ['copy-prod-images', 'build-prod-css'], function(){
|
|
||||||
var prodGroup = [
|
var prodGroup = [
|
||||||
config.paths.vendors + 'underscore-amd/underscore.js',
|
config.paths.vendors + 'underscore-amd/underscore.js',
|
||||||
config.paths.src + 'vendors/colorpicker/js/colorpicker.js',
|
config.paths.src + 'vendors/colorpicker/js/colorpicker.js',
|
||||||
@@ -97,4 +92,15 @@ gulp.task('build-prod', ['copy-prod-images', 'build-prod-css'], function(){
|
|||||||
config.paths.vendors + 'fancytree/dist/jquery.fancytree-all.min.js'
|
config.paths.vendors + 'fancytree/dist/jquery.fancytree-all.min.js'
|
||||||
];
|
];
|
||||||
return utils.buildJsGroup(prodGroup, 'prod', 'prod/js');
|
return utils.buildJsGroup(prodGroup, 'prod', 'prod/js');
|
||||||
|
});
|
||||||
|
gulp.task('watch-prod-js', function() {
|
||||||
|
return gulp.watch(config.paths.src + 'prod/**/*.js', ['build-prod-js']);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('watch-prod-css', function() {
|
||||||
|
return gulp.watch(config.paths.src + 'prod/**/*.scss', ['build-prod-css']);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('build-prod', ['copy-prod-images', 'build-prod-css'], function(){
|
||||||
|
return gulp.start('build-prod-js');
|
||||||
});
|
});
|
@@ -19,11 +19,7 @@ gulp.task('build-report-css', ['build-report-print-css'], function(){
|
|||||||
], 'report', 'report/css/');
|
], 'report', 'report/css/');
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('watch-report', function() {
|
gulp.task('build-report-js', function(){
|
||||||
gulp.watch(config.paths.src + 'report/**/*.scss', ['build-report-css']);
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('build-report', ['copy-report-images', 'build-report-css'], function(){
|
|
||||||
var reportGroup = [
|
var reportGroup = [
|
||||||
config.paths.src + 'report/js/jquery.print.js',
|
config.paths.src + 'report/js/jquery.print.js',
|
||||||
config.paths.src + 'report/js/jquery.cluetip.js',
|
config.paths.src + 'report/js/jquery.cluetip.js',
|
||||||
@@ -32,4 +28,16 @@ gulp.task('build-report', ['copy-report-images', 'build-report-css'], function()
|
|||||||
config.paths.src + 'report/js/report.js'
|
config.paths.src + 'report/js/report.js'
|
||||||
];
|
];
|
||||||
return utils.buildJsGroup(reportGroup, 'report', 'report/js');
|
return utils.buildJsGroup(reportGroup, 'report', 'report/js');
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('watch-report-js', function() {
|
||||||
|
return gulp.watch(config.paths.src + 'report/**/*.js', ['build-report-js']);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('watch-report-css', function() {
|
||||||
|
gulp.watch(config.paths.src + 'report/**/*.scss', ['build-report-css']);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('build-report', ['copy-report-images', 'build-report-css'], function(){
|
||||||
|
return gulp.start('build-report-js');
|
||||||
});
|
});
|
@@ -12,11 +12,7 @@ gulp.task('build-setup-css', function(){
|
|||||||
], 'setup', 'setup/css/');
|
], 'setup', 'setup/css/');
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('watch-setup', function() {
|
gulp.task('build-setup-js', function(){
|
||||||
gulp.watch(config.paths.src + 'setup/**/*.scss', ['build-setup-css']);
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('build-setup', ['copy-setup-images', 'build-setup-css'], function(){
|
|
||||||
var setupGroup = [
|
var setupGroup = [
|
||||||
config.paths.vendors + 'jquery.cookie/jquery.cookie.js',
|
config.paths.vendors + 'jquery.cookie/jquery.cookie.js',
|
||||||
config.paths.src + 'vendors/jquery-validation/js/jquery.validate.js',
|
config.paths.src + 'vendors/jquery-validation/js/jquery.validate.js',
|
||||||
@@ -24,4 +20,16 @@ gulp.task('build-setup', ['copy-setup-images', 'build-setup-css'], function(){
|
|||||||
config.paths.src + 'setup/js/path_files_tests.jquery.js'
|
config.paths.src + 'setup/js/path_files_tests.jquery.js'
|
||||||
];
|
];
|
||||||
return utils.buildJsGroup(setupGroup, 'setup', 'setup/js');
|
return utils.buildJsGroup(setupGroup, 'setup', 'setup/js');
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('watch-setup-js', function() {
|
||||||
|
return gulp.watch(config.paths.src + 'setup/**/*.js', ['build-setup-js']);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('watch-setup-css', function() {
|
||||||
|
gulp.watch(config.paths.src + 'setup/**/*.scss', ['build-setup-css']);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('build-setup', ['copy-setup-images', 'build-setup-css'], function(){
|
||||||
|
return gulp.start('build-setup-js');
|
||||||
});
|
});
|
@@ -12,11 +12,7 @@ gulp.task('build-thesaurus-css', function(){
|
|||||||
], 'thesaurus', 'thesaurus/css/');
|
], 'thesaurus', 'thesaurus/css/');
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('watch-thesaurus', function() {
|
gulp.task('build-thesaurus-js', function(){
|
||||||
gulp.watch(config.paths.src + 'thesaurus/**/*.scss', ['build-thesaurus-css']);
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('build-thesaurus', ['copy-thesaurus-images', 'build-thesaurus-css'], function(){
|
|
||||||
var thesaurusGroup = [
|
var thesaurusGroup = [
|
||||||
config.paths.src + 'vendors/jquery-sprintf/js/jquery.sprintf.1.0.3.js',
|
config.paths.src + 'vendors/jquery-sprintf/js/jquery.sprintf.1.0.3.js',
|
||||||
config.paths.src + 'thesaurus/js/win.js',
|
config.paths.src + 'thesaurus/js/win.js',
|
||||||
@@ -25,4 +21,16 @@ gulp.task('build-thesaurus', ['copy-thesaurus-images', 'build-thesaurus-css'], f
|
|||||||
config.paths.src + 'thesaurus/js/sprintf.js'
|
config.paths.src + 'thesaurus/js/sprintf.js'
|
||||||
];
|
];
|
||||||
return utils.buildJsGroup(thesaurusGroup, 'thesaurus', 'thesaurus/js');
|
return utils.buildJsGroup(thesaurusGroup, 'thesaurus', 'thesaurus/js');
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('watch-thesaurus-js', function() {
|
||||||
|
return gulp.watch(config.paths.src + 'thesaurus/**/*.js', ['build-thesaurus-js']);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('watch-thesaurus-css', function() {
|
||||||
|
gulp.watch(config.paths.src + 'thesaurus/**/*.scss', ['build-thesaurus-css']);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('build-thesaurus', ['copy-thesaurus-images', 'build-thesaurus-css'], function(){
|
||||||
|
return gulp.start('build-thesaurus-js');
|
||||||
});
|
});
|
@@ -5,22 +5,43 @@ var debug = require('gulp-debug');
|
|||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var utils = require('./utils.js');
|
var utils = require('./utils.js');
|
||||||
|
|
||||||
gulp.task('watch', function(){
|
gulp.task('watch-css', function(){
|
||||||
gulp.start('watch-common');
|
gulp.start('watch-common-css');
|
||||||
gulp.start('watch-oauth');
|
gulp.start('watch-oauth-css');
|
||||||
gulp.start('watch-prod');
|
gulp.start('watch-prod-css');
|
||||||
gulp.start('watch-thesaurus');
|
gulp.start('watch-thesaurus-css');
|
||||||
//gulp.start('watch-uploadFlash');
|
//gulp.start('watch-uploadFlash');
|
||||||
gulp.start('watch-lightbox');
|
gulp.start('watch-lightbox-css');
|
||||||
gulp.start('watch-admin');
|
gulp.start('watch-admin-css');
|
||||||
gulp.start('watch-report');
|
gulp.start('watch-report-css');
|
||||||
gulp.start('watch-account');
|
gulp.start('watch-account-css');
|
||||||
// gulp.start('watch-permaview');
|
// gulp.start('watch-permaview');
|
||||||
gulp.start('watch-setup');
|
gulp.start('watch-setup-css');
|
||||||
gulp.start('watch-authentication');
|
gulp.start('watch-authentication-css');
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('watch-js', function(){
|
||||||
|
gulp.start('watch-common-js');
|
||||||
|
// gulp.start('watch-oauth-js');
|
||||||
|
gulp.start('watch-prod-js');
|
||||||
|
gulp.start('watch-thesaurus-js');
|
||||||
|
//gulp.start('watch-uploadFlash');
|
||||||
|
gulp.start('watch-lightbox-js');
|
||||||
|
gulp.start('watch-admin-js');
|
||||||
|
gulp.start('watch-report-js');
|
||||||
|
gulp.start('watch-account-js');
|
||||||
|
// gulp.start('watch-permaview');
|
||||||
|
gulp.start('watch-setup-js');
|
||||||
|
gulp.start('watch-authentication-js');
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('watch', function(){
|
||||||
|
gulp.start('watch-css');
|
||||||
|
gulp.start('watch-js');
|
||||||
});
|
});
|
||||||
|
|
||||||
var browserSync = require('browser-sync').create();
|
var browserSync = require('browser-sync').create();
|
||||||
|
|
||||||
gulp.task('sync', ['watch'], function(){
|
gulp.task('sync', ['watch'], function(){
|
||||||
// will open browser in http://localhost:3000/
|
// will open browser in http://localhost:3000/
|
||||||
browserSync.init({
|
browserSync.init({
|
||||||
|
Reference in New Issue
Block a user