Permalink
Browse files

Implement simple gulp task to generate less files

Usage:
  npm install
  npm run build
  npm run start
  • Loading branch information...
1 parent 144a6ed commit 21749daf6ee4f3ce7b94172ff3f9180ca1d9a600 @mvantellingen mvantellingen committed Oct 26, 2015
View
@@ -3,6 +3,7 @@
*.egg-info
/dist/
/build/
+/node_modules/
# Vagrant
.vagrant
View
@@ -93,12 +93,8 @@ compiledmessages:
cd src/oscar; django-admin.py compilemessages
css:
- # Compile CSS files from LESS
- lessc --source-map --source-map-less-inline src/oscar/static/oscar/less/styles.less src/oscar/static/oscar/css/styles.css
- lessc --source-map --source-map-less-inline src/oscar/static/oscar/less/dashboard.less src/oscar/static/oscar/css/dashboard.css
- # Compile CSS for demo site
- lessc --source-map --source-map-less-inline sites/demo/static/demo/less/styles.less sites/demo/static/demo/css/styles.css
- lessc --source-map --source-map-less-inline sites/demo/static/demo/less/responsive.less sites/demo/static/demo/css/responsive.css
+ npm install
+ npm run build
clean:
# Remove files not in source control
@@ -0,0 +1,2 @@
+var requireDir = require('require-dir');
+requireDir('./tasks', { recurse: true });
@@ -0,0 +1,3 @@
+var gulp = require('gulp');
+
+gulp.task('default', ['less']);
@@ -0,0 +1,16 @@
+var gulp = require('gulp'),
+ less = require('gulp-less'),
+ sourcemaps = require('gulp-sourcemaps'),
+ less_task = function() {
+ gulp.src('src/oscar/static/oscar/less/*.less')
+ .pipe(less({
+ includePaths: [
+ 'src/oscar/static/less/',
+ ],
+ outputStyle: null,
+ }))
+ .pipe(sourcemaps.write('src/oscar/static/oscar/css/'))
+ .pipe(gulp.dest('src/oscar/static/oscar/css/'));
+ };
+
+gulp.task('less', less_task);
@@ -0,0 +1,8 @@
+var gulp = require('gulp');
+
+gulp.task('watch', function() {
+ var watch = require('gulp-watch');
+
+ gulp.watch('src/oscar/static/oscar/less/**/*.less', ['less']);
+ gulp.watch('sites/demo/static/demo/less/**/*.less', ['demo:less']);
+});
View
@@ -0,0 +1,22 @@
+{
+ "name": "django-oscar",
+ "version": "1.1.1",
+ "description": "A domain-driven e-commerce framework for Django",
+ "main": "index.js",
+ "dependencies": {},
+ "devDependencies": {
+ "gulp": "~3.8.11",
+ "gulp-autoprefixer": "~1.0.1",
+ "gulp-less": "^3.0.5",
+ "gulp-sourcemaps": "^1.6.0",
+ "gulp-watch": "^4.3.5",
+ "less": "^2.5.3",
+ "require-dir": "^0.3.0"
+ },
+ "scripts": {
+ "build": "gulp",
+ "start": "gulp watch"
+ },
+ "license": "MIT",
+ "homepage": "https://github.com/django-oscar/django-oscar#readme"
+}
View
@@ -13,7 +13,7 @@ Werkzeug==0.9.6
Whoosh==2.6.0
pysolr==3.2.0
requests==2.7.0
-uWSGI==2.0.8
+uWSGI==2.0.11.2
# Docs
Sphinx==1.2.3
Oops, something went wrong.

0 comments on commit 21749da

Please sign in to comment.