Added gulpfile and dev dependencies
This commit is contained in:
parent
9423d56bb2
commit
a5ef19c6f9
115
gulpfile.js
Normal file
115
gulpfile.js
Normal file
|
@ -0,0 +1,115 @@
|
|||
var gulp = require('gulp');
|
||||
var less = require('gulp-less');
|
||||
var sourcemaps = require('gulp-sourcemaps');
|
||||
var clean = require('gulp-clean');
|
||||
var include = require('gulp-include');
|
||||
var uglify = require('gulp-uglify');
|
||||
|
||||
var cssDestination = './public/temp/css';
|
||||
var jsDestination = './public/temp/js';
|
||||
|
||||
gulp.task('default', [
|
||||
'build'
|
||||
]);
|
||||
|
||||
gulp.task('build', [
|
||||
'less-vendor',
|
||||
'less-highlight',
|
||||
'less-custom',
|
||||
'scripts-vendor',
|
||||
'scripts-highlight',
|
||||
'scripts-custom'
|
||||
]);
|
||||
|
||||
gulp.task('less-vendor', function () {
|
||||
return gulp
|
||||
.src('./public/assets/less/vendor.less')
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(less({
|
||||
paths: [
|
||||
__dirname + '/node_modules'
|
||||
]
|
||||
})).on('error', console.log)
|
||||
.pipe(sourcemaps.write('.'))
|
||||
.pipe(gulp.dest(cssDestination));
|
||||
});
|
||||
|
||||
gulp.task('less-highlight', function () {
|
||||
return gulp
|
||||
.src('./public/assets/less/highlight.less')
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(less({
|
||||
paths: [
|
||||
__dirname + '/node_modules'
|
||||
]
|
||||
})).on('error', console.log)
|
||||
.pipe(sourcemaps.write('.'))
|
||||
.pipe(gulp.dest(cssDestination));
|
||||
});
|
||||
|
||||
gulp.task('less-custom', function () {
|
||||
return gulp
|
||||
.src('./public/assets/less/index.less')
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(less({
|
||||
paths: [
|
||||
__dirname + '/node_modules'
|
||||
]
|
||||
})).on('error', console.log)
|
||||
.pipe(sourcemaps.write('.'))
|
||||
.pipe(gulp.dest(cssDestination));
|
||||
});
|
||||
|
||||
gulp.task('scripts-vendor', function () {
|
||||
return gulp
|
||||
.src('./public/assets/scripts/vendor.js')
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(include({
|
||||
includePaths: [
|
||||
__dirname + '/node_modules'
|
||||
]
|
||||
})).on('error', console.log)
|
||||
.pipe(uglify())
|
||||
.pipe(sourcemaps.write('.'))
|
||||
.pipe(gulp.dest(jsDestination));
|
||||
});
|
||||
|
||||
gulp.task('scripts-highlight', function () {
|
||||
return gulp
|
||||
.src('./public/assets/scripts/highlight.js')
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(include({
|
||||
includePaths: [
|
||||
__dirname + '/node_modules'
|
||||
]
|
||||
})).on('error', console.log)
|
||||
.pipe(uglify())
|
||||
.pipe(sourcemaps.write('.'))
|
||||
.pipe(gulp.dest(jsDestination));
|
||||
});
|
||||
|
||||
gulp.task('scripts-custom', function () {
|
||||
return gulp
|
||||
.src('./public/assets/scripts/index.js')
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(include({
|
||||
includePaths: [
|
||||
__dirname + '/node_modules'
|
||||
]
|
||||
})).on('error', console.log)
|
||||
.pipe(uglify())
|
||||
.pipe(sourcemaps.write('.'))
|
||||
.pipe(gulp.dest(jsDestination));
|
||||
});
|
||||
|
||||
gulp.task('clean', function () {
|
||||
return gulp
|
||||
.src([cssDestination, jsDestination])
|
||||
.pipe(clean());
|
||||
});
|
||||
|
||||
gulp.task('watch', function () {
|
||||
return gulp
|
||||
.watch('./public/assets/less/*.less', ['less-custom'])
|
||||
.watch('./public/assets/scripts/*.js', ['scripts-custom']);
|
||||
});
|
15
package.json
15
package.json
|
@ -18,9 +18,20 @@
|
|||
"email": "security@gitea.io"
|
||||
},
|
||||
"config": {},
|
||||
"scripts": {},
|
||||
"scripts": {
|
||||
"build": "gulp build",
|
||||
"clean": "gulp clean",
|
||||
"watch": "gulp watch"
|
||||
},
|
||||
"main": "",
|
||||
"devDependencies": {},
|
||||
"devDependencies": {
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-clean": "^0.3.2",
|
||||
"gulp-include": "^2.3.1",
|
||||
"gulp-less": "^3.3.0",
|
||||
"gulp-sourcemaps": "^1.9.1",
|
||||
"gulp-uglify": "^2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@claviska/jquery-minicolors": "^2.2.4",
|
||||
"@ryancavanaugh/jquery.are-you-sure": "0.0.14-alpha",
|
||||
|
|
Loading…
Reference in New Issue
Block a user