commit
f56717b80b
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
*.log
|
*.log
|
||||||
.idea/
|
.idea/
|
||||||
|
production/
|
||||||
|
30
gulpfile.js
Normal file
30
gulpfile.js
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
var gulp = require('gulp');
|
||||||
|
var cssmin = require('gulp-cssmin');
|
||||||
|
var uglify = require('gulp-uglify');
|
||||||
|
var nodemon = require('gulp-nodemon');
|
||||||
|
var gif = require('gulp-if');
|
||||||
|
|
||||||
|
var inProduction = process.env['NODE_ENV'] == 'production';
|
||||||
|
|
||||||
|
gulp.task('asset-css', function() {
|
||||||
|
gulp.src('assets/css/main.css')
|
||||||
|
.pipe(gif(inProduction, cssmin()))
|
||||||
|
.pipe(gulp.dest('production/css'));
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
gulp.task('asset-js', function() {
|
||||||
|
gulp.src('assets/js/*')
|
||||||
|
.pipe(gif(inProduction, uglify()))
|
||||||
|
.pipe(gulp.dest('production/js'));
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('build', ['asset-css', 'asset-js']);
|
||||||
|
|
||||||
|
gulp.task('watch-app', function() {
|
||||||
|
nodemon({
|
||||||
|
script: 'app.js',
|
||||||
|
ext: 'js json',
|
||||||
|
env: {'NODE_ENV': 'development'}
|
||||||
|
});
|
||||||
|
});
|
@ -23,5 +23,12 @@
|
|||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/Cryptkeeper/Minetrack/issues"
|
"url": "https://github.com/Cryptkeeper/Minetrack/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/Cryptkeeper/Minetrack#README"
|
"homepage": "https://github.com/Cryptkeeper/Minetrack#README",
|
||||||
|
"devDependencies": {
|
||||||
|
"gulp": "^3.9.0",
|
||||||
|
"gulp-cssmin": "^0.1.7",
|
||||||
|
"gulp-if": "^2.0.0",
|
||||||
|
"gulp-nodemon": "^2.0.4",
|
||||||
|
"gulp-uglify": "^1.5.1"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user