diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..c2658d7d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules/ diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 00000000..a902bfd1 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,23 @@ +'use strict'; + +var gulp = require('gulp'); +var prettify = require('gulp-jsbeautifier'); + +var sources = ['**/*.js', '**/*.css', '**/*.html', '!node_modules/**']; + +gulp.task('prettify', function() { + gulp.src(sources) + .pipe(prettify({ + html: { + indentSize: 2 + }, + css: { + indentSize: 2 + }, + js: { + indentSize: 2, + braceStyle: "end-expand" + } + })) + .pipe(gulp.dest('.')); +}); diff --git a/package.json b/package.json index d7879911..8a9c594b 100644 --- a/package.json +++ b/package.json @@ -4,5 +4,9 @@ "description": "", "main": "main.js", "author": "Yuya Ochiai", - "license": "MIT" + "license": "MIT", + "devDependencies": { + "gulp": "^3.9.0", + "gulp-jsbeautifier": "^1.0.1" + } }