Skip to content

Commit

Permalink
Issue #248 Move bower_component js files to concatenated scripts.js f…
Browse files Browse the repository at this point in the history
…ile. Add gulp concatenate task.
  • Loading branch information
WesTyler committed Mar 6, 2016
1 parent 50e9da8 commit 67b3295
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 31 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
bower_components
client/scripts.js
.DS_Store
server/config.js
server/access.log
Expand Down
15 changes: 1 addition & 14 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,9 @@
<html>
<head>
<title>m o d u l o</title>
<!-- javascript files -->
<script src="/scripts/underscore/underscore-min.js"></script>
<script src="/scripts/jquery/dist/jquery.min.js"></script>
<script src="/scripts/angular/angular.min.js"></script>
<script src="/scripts/angular-ui-router/release/angular-ui-router.min.js"></script>
<script src="/scripts/moment/min/moment.min.js"></script>
<script src="/scripts/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="/scripts/d3/d3.min.js"></script>
<script src="/scripts/d3-tip/index.js"></script>
<script src='/scripts/angular-loading-bar/build/loading-bar.min.js'></script>
<script src='./scripts.js'></script>
<script src="./sigma/sigma.min.js"></script>
<script src="./sigma/plugins/sigma.parsers.json.min.js"></script>
<script src="/scripts/zeroclipboard/dist/ZeroClipboard.js"></script>
<script src="/scripts/angular-sanitize/angular-sanitize.js"></script>
<script src="/scripts/showdown/dist/showdown.js"></script>
<script src="/scripts/ng-showdown/dist/ng-showdown.js"></script>
<!-- stylesheets -->
<link rel='stylesheet' href='/scripts/angular-loading-bar/build/loading-bar.min.css' type='text/css' media='all'/>
<link rel="stylesheet" href="/scripts/bootstrap/dist/css/bootstrap.min.css">
Expand Down
50 changes: 34 additions & 16 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,44 @@
// Dependencies
// -----------------------------------------------------------------------------

var gulp = require('gulp');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var autoprefixer = require('gulp-autoprefixer');
var sassdoc = require('sassdoc');
var gulp = require('gulp'),
sass = require('gulp-sass'),
sourcemaps = require('gulp-sourcemaps'),
autoprefixer = require('gulp-autoprefixer'),
sassdoc = require('sassdoc'),
concat = require('gulp-concat');


// -----------------------------------------------------------------------------
// Configuration
// -----------------------------------------------------------------------------

var input = 'client/styles/*.scss';
var output = 'client/';
var sassOptions = { outputStyle: 'expanded' };
var autoprefixerOptions = { browsers: ['last 2 versions', '> 5%', 'Firefox ESR'] };
var sassdocOptions = { dest: 'dist/sassdoc' };
var input = 'client/styles/*.scss',
output = 'client/',
sassOptions = { outputStyle: 'expanded' },
autoprefixerOptions = { browsers: ['last 2 versions', '> 5%', 'Firefox ESR'] },
sassdocOptions = { dest: 'dist/sassdoc' },
bowerPath = './bower_components/',
bowerComponents = [
bowerPath + 'underscore/underscore.js',
bowerPath + 'jquery/dist/jquery.js',
bowerPath + 'angular/angular.js',
bowerPath + 'angular-ui-router/release/angular-ui-router.js',
bowerPath + 'moment/moment.js',
bowerPath + 'bootstrap/dist/js/bootstrap.js',
bowerPath + 'd3/d3.js',
bowerPath + 'd3-tip/index.js',
bowerPath + 'angular-loading-bar/src/loading-bar.js',
bowerPath + 'zeroclipboard/dist/ZeroClipboard.js',
bowerPath + 'angular-sanitize/angular-sanitize.js',
bowerPath + 'showdown/dist/showdown.js',
bowerPath + 'ng-showdown/dist/ng-showdown.js',
bowerPath + 'angular-markdown-directive/markdown.js'
];


// -----------------------------------------------------------------------------
// Sass compilation
// Tasks
// -----------------------------------------------------------------------------

gulp.task('sass', function () {
Expand All @@ -37,18 +55,18 @@ gulp.task('sass', function () {
.pipe(gulp.dest(output));
});


// -----------------------------------------------------------------------------
// Sass documentation generation
// -----------------------------------------------------------------------------

gulp.task('sassdoc', function () {
return gulp
.src(input)
.pipe(sassdoc(sassdocOptions))
.resume();
});

gulp.task('concatenate', function() {
return gulp.src(bowerComponents)
.pipe(concat('scripts.js'))
.pipe(gulp.dest('./client/'));
});

// -----------------------------------------------------------------------------
// Watchers
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
"del": "^1.2.1",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^2.3.1",
"gulp-sass": "^2.0.4"
"gulp-concat": "^2.6.0",
"gulp-minify-css": "^1.2.3",
"gulp-sass": "^2.0.4",
"gulp-uglifyjs": "^0.6.2",
"gulp-usemin": "^0.3.20",
"main-bower-files": "^2.11.1"
}
}

0 comments on commit 67b3295

Please sign in to comment.