Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/haensl/gulp-minify-inline-json
Minifies inline <script> tags containing JSON data, i.e. application/json and application/ld+json.
https://github.com/haensl/gulp-minify-inline-json
gulp gulp-plugin gulpplugin html inline json minify npm script
Last synced: 3 days ago
JSON representation
Minifies inline <script> tags containing JSON data, i.e. application/json and application/ld+json.
- Host: GitHub
- URL: https://github.com/haensl/gulp-minify-inline-json
- Owner: haensl
- License: mit
- Created: 2017-11-15T00:22:01.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-06-11T08:51:26.000Z (5 months ago)
- Last Synced: 2024-10-30T16:51:45.697Z (14 days ago)
- Topics: gulp, gulp-plugin, gulpplugin, html, inline, json, minify, npm, script
- Language: JavaScript
- Size: 358 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# gulp-minify-inline-json
[![NPM](https://nodei.co/npm/gulp-minify-inline-json.png?downloads=true)](https://nodei.co/npm/gulp-minify-inline-json/)
[![npm version](https://badge.fury.io/js/gulp-minify-inline-json.svg)](http://badge.fury.io/js/gulp-minify-inline-json)
[![CircleCI](https://circleci.com/gh/haensl/gulp-minify-inline-json.svg?style=svg)](https://circleci.com/gh/haensl/gulp-minify-inline-json)Minifies inline `` tags containing JSON data, i.e. `application/json` and `application/ld+json`.
## Installation
```shell
npm i --save-dev gulp-minify-inline-json
```## Usage
```javascript
const minifyInlineJSON = require('gulp-minify-inline-json');gulp.task('minifyInlineJSON', () =>
gulp.src('*.html')
.pipe(minifyInlineJSON())
.pipe(gulp.dest('dist/')));
```## Options
### mimeTypes `Array<string>`
Provide custom mime types to specify which `<script>` tags to minify.
##### default: `[ 'application/json', 'application/ld+json' ]`
##### Example: Minify only tags with `type="application/ld+json"`
###### HTML Layout
```html
<html>
<head><!-- ... --></head>
<body>
<!-- ... -->
<script type="application/json">{
"some": "json"
}
{
"foo": "bar"
}
{
"some": "json"
}
{"foo":"bar"}