1.0.3 • Published 8 years ago

gulp-concat-to-json v1.0.3

Weekly downloads
36
License
ISC
Repository
github
Last release
8 years ago

gulp-concat-to-json

concat files and convert the content to JSON

example, concat all html templates to a js file:

var concatToJson = require('gulp-concat-to-json')

gulp.src('./tpl/**/*.html')
    .pipe(minifyHTML({conditionals: true, spare: true}))
    .pipe(concatToJson(path.join(__dirname), path.join(__dirname, 'tpl/all_templates.js')))
    .pipe(replace(/^/, 'module.exports = '))
    .pipe(gulp.dest('./tpl/'))

files:

tpl/a.html:

<h1>Hi</h1>

tpl/b.html

<div>Hi</div>

convert to:

tpl/all_templates.js

{
  "tpl/a.html": "<h1>Hi</h1>",
  "tpl/b.html": "<div>Hi</div>"
}
1.0.3

8 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago