Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions tools/gulp.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/**
* This stores all the configuration information for Gulp
*/
module.exports = function () {
var paths = {
src: '../src/',
dist: '../dist/'
};

var config = {
paths: paths,

jsSourceFiles: [
paths.src + '**/*.js'
],

jsLibs: [
paths.dist + 'lib/angular/angular.js',
paths.dist + 'lib/angular-gettext/dist/angular-gettext.js',
paths.dist + 'lib/angular-sanitize/angular-sanitize.js',
paths.dist + 'lib/angular-bootstrap/ui-bootstrap.js',
paths.dist + 'lib/angular-bootstrap/ui-bootstrap-tpls.js',
paths.dist + 'lib/angular-ui-router/release/angular-ui-router.js',
paths.dist + 'lib/lodash/lodash.js',
paths.dist + 'lib/helion-ui-framework/**/*.module.js',
paths.dist + 'lib/helion-ui-framework/**/*.js'
],

plugins: [],

jsFiles: [
paths.dist + 'index.module.js',
paths.dist + 'app/**/*.module.js',
paths.dist + 'app/**/*.js',
'!' + paths.dist + '**/*.mock.js',
'!' + paths.dist + '**/*.spec.js'
],

scssSourceFiles: [
paths.src + 'index.scss'
],

scssFiles: [
paths.src + '**/*.scss'
],

cssFiles: [
paths.dist + 'index.css'
],

partials: [
paths.src + 'app/**/*.html'
]
};

return config;
};
67 changes: 11 additions & 56 deletions tools/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,62 +8,17 @@ var sass = require('gulp-sass');
var eslint = require('gulp-eslint');
var del = require('del');


var paths = {
src: '../src/',
dist: '../dist/'
};


var jsSourceFiles = [
paths.src + '**/*.js'
];


var jsLibs = [
paths.dist + 'lib/angular/angular.js',
paths.dist + 'lib/angular-gettext/dist/angular-gettext.js',
paths.dist + 'lib/angular-sanitize/angular-sanitize.js',
paths.dist + 'lib/angular-bootstrap/ui-bootstrap.js',
paths.dist + 'lib/angular-bootstrap/ui-bootstrap-tpls.js',
paths.dist + 'lib/angular-ui-router/release/angular-ui-router.js',
paths.dist + 'lib/lodash/lodash.js',
paths.dist + 'lib/helion-ui-framework/**/*.module.js',
paths.dist + 'lib/helion-ui-framework/**/*.js'
];


var plugins = [
];


var jsFiles = [
paths.dist + 'index.module.js',
paths.dist + 'app/**/*.module.js',
paths.dist + 'app/**/*.js',
'!' + paths.dist + '**/*.mock.js',
'!' + paths.dist + '**/*.spec.js'
];


var scssSourceFiles = [
paths.src + 'index.scss'
];


var scssFiles = [
paths.src + '**/*.scss'
]


var cssFiles = [
paths.dist + 'index.css'
];


var partials = [
paths.src + 'app/**/*.html'
];
// Paths are stored in gulp.config.js
var config = require('./gulp.config')();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is great!

can we create aliases for path, jsSourceFiles, etc. so that we have a little bit more cleaner code? for example:

var path = config.path
, jsSourceFiles = config.jsSourceFiles
, jsLibs = config. jsLibs
...
This way we don't need to make changes in tasks.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

var paths = config.paths,
jsSourceFiles = config.jsSourceFiles,
jsLibs = config.jsLibs,
plugins = config.plugins,
jsFiles = config.jsFiles,
scssSourceFiles = config.scssSourceFiles,
scssFiles = config.scssFiles,
cssFiles = config.cssFiles,
partials = config.partials;


gulp.task('js', function () {
Expand Down