mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-02-01 04:42:21 +00:00
Add basic gulp build system
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -25,6 +25,7 @@ var/
|
|||||||
*.egg-info/
|
*.egg-info/
|
||||||
.installed.cfg
|
.installed.cfg
|
||||||
*.egg
|
*.egg
|
||||||
|
node_modules/
|
||||||
|
|
||||||
# Continer extras
|
# Continer extras
|
||||||
.vagrant
|
.vagrant
|
||||||
|
|||||||
68
gulpfile.js
Normal file
68
gulpfile.js
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var gulp = require('gulp');
|
||||||
|
|
||||||
|
var sourcemaps = require('gulp-sourcemaps');
|
||||||
|
|
||||||
|
var sass = require('gulp-sass');
|
||||||
|
var concat = require('gulp-concat');
|
||||||
|
|
||||||
|
var batch = require('gulp-batch');
|
||||||
|
var watch = require('gulp-watch');
|
||||||
|
|
||||||
|
var APPS = [
|
||||||
|
'RIGS'
|
||||||
|
];
|
||||||
|
|
||||||
|
var SASS_INCLUDE_PATHS = APPS.map(function (elem) {
|
||||||
|
return './' + elem + '/static/scss'
|
||||||
|
}).concat(['./node_modules']);
|
||||||
|
|
||||||
|
function css(opts) {
|
||||||
|
return gulp.src('PyRIGS/static/scss/screen.scss')
|
||||||
|
.pipe(sourcemaps.init())
|
||||||
|
.pipe(sass(
|
||||||
|
{includePaths: SASS_INCLUDE_PATHS}
|
||||||
|
)).on('error', sass.logError)
|
||||||
|
.pipe(sourcemaps.write('.'))
|
||||||
|
.pipe(gulp.dest('dist/css'));
|
||||||
|
}
|
||||||
|
|
||||||
|
gulp.task('css', function () {
|
||||||
|
return css()
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('watch', function () {
|
||||||
|
batch(function (events, done) {
|
||||||
|
gulp.start('css', done);
|
||||||
|
});
|
||||||
|
watch(SASS_INCLUDE_PATHS.concat(['PyRIGS/static/scss/screen.scss']), batch(function (events, done) {
|
||||||
|
gulp.start('css', done);
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
|
||||||
|
// JS
|
||||||
|
|
||||||
|
var JS_LIBS = [
|
||||||
|
'./node_modules/jquery/dist/jquery.js',
|
||||||
|
'./node_modules/tether/dist/js/tether.js',
|
||||||
|
'./node_modules/bootstrap/dist/js/bootstrap.js'
|
||||||
|
];
|
||||||
|
|
||||||
|
function js_lib() {
|
||||||
|
return gulp.src(JS_LIBS)
|
||||||
|
.pipe(sourcemaps.init())
|
||||||
|
.pipe(concat('lib.js'))
|
||||||
|
.pipe(sourcemaps.write('.'))
|
||||||
|
.pipe(gulp.dest('dist/js'));
|
||||||
|
}
|
||||||
|
|
||||||
|
gulp.task('js_lib', function () {
|
||||||
|
return js_lib()
|
||||||
|
});
|
||||||
|
|
||||||
|
// Frontend tasks
|
||||||
|
gulp.task('frontend', [
|
||||||
|
'css',
|
||||||
|
'js_lib'
|
||||||
|
]);
|
||||||
18
package.json
Normal file
18
package.json
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"name": "pyrigs",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/nottinghamtec/PyRIGS.git"
|
||||||
|
},
|
||||||
|
"private": true,
|
||||||
|
"devDependencies": {
|
||||||
|
"gulp": "^3.9.1",
|
||||||
|
"gulp-batch": "^1.0.5",
|
||||||
|
"gulp-concat": "^2.6.1",
|
||||||
|
"gulp-less": "^3.3.0",
|
||||||
|
"gulp-sass": "^3.1.0",
|
||||||
|
"gulp-sourcemaps": "^2.6.0",
|
||||||
|
"gulp-watch": "^4.3.11"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user