From 3004e117bba4c005733dac8b2eefe24b4845274e Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Fri, 23 Oct 2015 23:56:53 +0900 Subject: [PATCH] =?UTF-8?q?gulp-jsbeautifier=E3=82=92=E5=B0=8E=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + gulpfile.js | 23 +++++++++++++++++++++++ package.json | 6 +++++- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 gulpfile.js 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" + } }