This package has been deprecated

Author message:

Plugins have been moved inside gulp-html-transform. See https://github.com/maistho/gulp-html-transform

gulp-html-transform-minify-inline-json
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

gulp-html-transform-minify-inline-json

This is a plugin for gulp-html-transform

Minifies inline <script> tags containing JSON data, i.e. application/json and application/ld+json.

Loosely based on gulp-minify-inline-json

Installing

Using npm

$ npm install --save gulp-html-transform-inline-json

Using yarn

$ yarn add gulp-html-transform-inline-json

Usage

gulpfile.js

const path = require('path')
const { transform } = require('gulp-html-transform')
const { minifyInlineJson } = require('gulp-html-transform-minify-inline-json')

gulp.task('html', () => {
  gulp.src('src/**/*.html')
  .pipe(transform(
    minifyInlineJson({
      mimetypes: ['application/json'], // optional
    })
  ))
  .pipe(gulp.dest('dist'))
})

If you want to add the styles manually you can import index.css from the package folder and remove addStyles.

Html in:

<script type="application/json">
{
  "key": {
    "other_key": "value"
  }
}
</script>

Html out:

<script type="application/json">{"key":{"other_key":"value"}}</script>

API

minifyInlineJson({
  mimetypes: ['application/json', 'application/ld+json'], // optional string array of mimeTypes.
})

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Published

Version History

  • Version
    Downloads (Last 7 Days)
    • Published

Package Sidebar

Install

npm i gulp-html-transform-minify-inline-json

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • maistho