This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
forked from DanBricklin/socialcalc
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathgulpfile.js
62 lines (58 loc) · 1.45 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* INSTALL
*
* This requires nodejs and npm to be installed:
* - https://nodejs.org/en/download/package-manager/
*
* Install gulp:
* - npm install -g gulp
*
* Install required gulp modules:
* - npm install gulp-util gulp-uglify gulp-rename gulp-minify-css gulp-concat
*
*
* RUN
*
* Create minified JS:
* - gulp scripts
*
* Create minified CSS:
* - gulp styles
*/
/* Needed gulp config */
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var minifyCss = require('gulp-minify-css');
var concat = require('gulp-concat');
/* scripts task */
gulp.task('scripts', function() {
return gulp.src([
/* Add your JS files here, they will be combined in this order */
'formatnumber2.js',
'formula1.js',
'socialcalc-3.js',
'socialcalcconstants.js',
'socialcalctableeditor.js',
'socialcalcpopup.js',
'socialcalcspreadsheetcontrol.js',
'socialcalcviewer.js'
])
.pipe(concat('socialcalc.js'))
.pipe(gulp.dest(''))
.pipe(rename({suffix: '.min'}))
.pipe(uglify())
.pipe(gulp.dest(''))
});
/* styles task */
gulp.task('styles', function() {
return gulp.src([
/* Add your CSS files here, they will be combined in this order */
'socialcalc.css',
])
.pipe(rename({suffix: '.min'}))
.pipe(minifyCss())
.pipe(gulp.dest(''))
});
// The default task (called when you run `gulp` from cli)
gulp.task('default', ['scripts', 'styles']);