{"id":15493353,"url":"https://github.com/exuanbo/gulp-inline-source-html","last_synced_at":"2025-04-11T20:42:51.636Z","repository":{"id":41887780,"uuid":"256407672","full_name":"exuanbo/gulp-inline-source-html","owner":"exuanbo","description":"Inlines flagged js, css, and img sources in html with inline-source","archived":false,"fork":false,"pushed_at":"2024-12-22T00:52:08.000Z","size":224,"stargazers_count":2,"open_issues_count":32,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T06:57:04.193Z","etag":null,"topics":["css","gulp","gulp-inline-source","gulpplugin","img","inline","inline-source","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/exuanbo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-17T05:16:03.000Z","updated_at":"2021-12-30T03:53:00.000Z","dependencies_parsed_at":"2024-01-05T17:46:34.867Z","dependency_job_id":"2d255a21-b948-485a-8129-a592315f9631","html_url":"https://github.com/exuanbo/gulp-inline-source-html","commit_stats":{"total_commits":158,"total_committers":4,"mean_commits":39.5,"dds":0.4113924050632911,"last_synced_commit":"c3e17a6293ed3da54b3573bc2f24aaddce6e54ea"},"previous_names":["exuanbo/gulp-inline-source"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exuanbo%2Fgulp-inline-source-html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exuanbo%2Fgulp-inline-source-html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exuanbo%2Fgulp-inline-source-html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exuanbo%2Fgulp-inline-source-html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exuanbo","download_url":"https://codeload.github.com/exuanbo/gulp-inline-source-html/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248441381,"owners_count":21103985,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","gulp","gulp-inline-source","gulpplugin","img","inline","inline-source","javascript"],"created_at":"2024-10-02T08:05:44.524Z","updated_at":"2025-04-11T20:42:51.600Z","avatar_url":"https://github.com/exuanbo.png","language":"JavaScript","funding_links":["https://www.buymeacoffee.com/exuanbo"],"categories":[],"sub_categories":[],"readme":"# gulp-inline-source-html\n\n\u003e Inlines flagged js, css, and img sources in html with [inline-source](https://github.com/popeindustries/inline-source)\n\n[![npm](https://img.shields.io/npm/v/gulp-inline-source-html.svg?style=flat-square)](https://www.npmjs.com/package/gulp-inline-source-html)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square)](https://standardjs.com)\n[![Travis (.com)](https://img.shields.io/travis/com/exuanbo/gulp-inline-source-html/master.svg?style=flat-square)](http://travis-ci.com/exuanbo/gulp-inline-source-html)\n[![David](https://img.shields.io/david/exuanbo/gulp-inline-source-html.svg?style=flat-square)](https://david-dm.org/exuanbo/gulp-inline-source-html)\n[![License](https://img.shields.io/github/license/exuanbo/gulp-inline-source-html.svg?style=flat-square)](https://github.com/exuanbo/gulp-inline-source-html/blob/master/LICENSE)\n\nThis plugin is based on [fmal/gulp-inline-source](https://github.com/fmal/gulp-inline-source), which is no longer maintained. It now supports Gulp.js v4 and ES6 / ES2015.\n\n## Table of Contents\n\n- [Description](#description)\n- [Installation](#installation)\n- [How it works](#how-it-works)\n- [Usage](#usage)\n- [License](#license)\n\n## Description\n\nInline and compress tags that contain the `inline` attribute. Supports `\u003cscript\u003e`, `\u003clink\u003e`, and `\u003cimg\u003e` (including `*.svg` sources) tags by default.\n\n## Installation\n\nInstall `gulp-inline-source-html` as a development dependency\n\n```bash\nnpm install --save-dev gulp-inline-source-html\n```\n\n## How it works\n\nTargate file `src/html/index.html`\n\n```html\n\u003chtml\u003e\n  \u003cbody\u003e\n    \u003cscript src=\"../js/app.js\" inline\u003e\u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\nSource file `src/js/app.js`\n\n```js\nfunction test() {\n  const foo = 'lorem ipsum';\n  return foo;\n}\n```\n\nOutput file\n\n```html\n\u003chtml\u003e\n  \u003cbody\u003e\n    \u003cscript\u003efunction test(){const a=\"lorem ipsum\";return a}\u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Usage\n\n`inlineSource(options?: Object)`\n\n```javascript\nconst { task, src, dest } = require('gulp')\nconst inlineSource = require('gulp-inline-source-html')\n\ntask('inlineSource', () =\u003e {\n  return src('src/*.html')\n    .pipe(inlineSource())\n    .pipe(dest('dist'))\n})\n```\n\nor you can\n\n```javascript\nimport inlineSource from 'gulp-inline-source-html'\n```\n\n```javascript\ntask('inlineSource', () =\u003e {\n  return src('src/*.html')\n    .pipe(inlineSource({ compress: false }))\n    .pipe(dest('dist'))\n})\n```\n\nAvailable `options` include:\n\n- `attribute`: attribute used to parse sources (all tags will be parsed if set to `false`. Default `'inline'`)\n- `compress`: enable/disable compression of inlined content (default `true`)\n- `fs`: specify `fs` implementation (default is Node core `'fs'`)\n- `handlers`: specify custom handlers (default `[]`) [see [custom handlers](#custom-handlers)]\n- `preHandlers`: specify custom pre handlers (default `[]`) [see [custom pre handlers](#custom-pre-handlers)]\n- `ignore`: disable inlining based on `tag`, `type`, and/or `format` (default `[]`)\n- `pretty`: maintain leading whitespace when `options.compress` is `false` (default `false`)\n- `rootpath`: directory path used for resolving inlineable paths (default `process.cwd()`)\n- `saveRemote`: enable/disable saving a local copy of remote sources (default `true`)\n- `svgAsImage`: convert `\u003cimg inline src=\"*.svg\" /\u003e` to `\u003cimg\u003e` and not `\u003csvg\u003e` (default `false`)\n- `swallowErrors`: enable/disable suppression of errors (default `false`)\n\nFor documentation about the options-object, see [popeindustries/inline-source](https://github.com/popeindustries/inline-source#usage).\n\n## License\n\n[MIT](https://github.com/exuanbo/gulp-inline-source-html/blob/master/LICENSE)\n\n## Donate\n\n\u003ca href=\"https://www.buymeacoffee.com/exuanbo\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/lato-orange.png\" alt=\"Buy Me A Coffee\" height=\"38.25px\" width=\"162.75px\"\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexuanbo%2Fgulp-inline-source-html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexuanbo%2Fgulp-inline-source-html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexuanbo%2Fgulp-inline-source-html/lists"}