{"_id":"@anvilco/grunt-embed","_rev":"5-84fadd27a522d8c2f101895bf7ee8431","name":"@anvilco/grunt-embed","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@anvilco/grunt-embed","version":"0.0.1","keywords":["gruntplugin"],"author":{"url":"https://github.com/callumlocke","name":"Callum Locke"},"license":"MIT","_id":"@anvilco/grunt-embed@0.0.1","maintainers":[{"name":"allan-anvil","email":"allan@useanvil.com"},{"name":"benogle","email":"ogle.ben@gmail.com"},{"name":"anvilbot","email":"services@useanvil.com"},{"name":"newhouse","email":"c.newhouse@gmail.com"},{"name":"winggo","email":"winggo.tse@gmail.com"},{"name":"fostimus","email":"derekfoster94@gmail.com"}],"homepage":"https://github.com/anvilco/grunt-embed","bugs":{"url":"https://github.com/anvilco/grunt-embed/issues"},"dist":{"shasum":"6133b0b2d4af4e93da372eac024c7fcda465f330","tarball":"https://registry.npmjs.org/@anvilco/grunt-embed/-/grunt-embed-0.0.1.tgz","fileCount":20,"integrity":"sha512-l0jMjxbFejDZgThdd1he1d83sQ2QKdO02rmT+7d990G5QYygGpMvRJA2mR6+5D2byA1BV7G/16mU1sf1TWR09w==","signatures":[{"sig":"MEQCIEwe8qhWIuj9eq3XmVpSdEFAk6eUbHhEqaasUhMwqyn2AiA8yFY7zC3QqzNcpRtaPB0s7O7e8rGVz5050QOhIbwoQA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16803,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJismNWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr8ZQ//Q7sBXebxF9O6RxAqqqv4QZ9JqyzYV/sK46ekbBuV9+cM+ppN\r\nrPswHcx3i2Q01lL7PH4Etvn6Sf+JtBcjaQDoOZLyJ0sezN7YevofdW2iOqrQ\r\nfSX9OaSIWVeb1GVQixGCaJrpyl71popnf8qokB9squgB3Y00jqXH4mwQxmY2\r\nYIkFuz3GdtQhl9zEPp7yEH6RPsS+yI3J7zckZAhAVFOnDjnkuzlBREXHaWGK\r\nLZXaSx8HYsw7P1cMZHZZT2A04YdcqzGtost5uDgHIaebf59S0cX4u75WbK2W\r\nk71Y7jmLJKJQDbADmc9zfniyLcdRGWS5YSHAa/RU0Igi8Uyz3VyNeel3W293\r\ngbLiDY72PnALHGoNFcvfyaW4AslmayW4YLbJahtpar4zn6T/xksif/Fb4bmp\r\nyMIUcz4buDe6Saz8SVdr5U9nMf7TsO88FzlsxjOG6/NiKo2r2lbV7JvM9+Q0\r\nxeYGWlUqa7gyZyp2uiAghA416Ehg3ks+p0buW46IJOTqcjGBUPP07qT4zD4Q\r\nvq20xlKf6M4ZhGxYNFdnUwUS9Ab+BrQs5NXN2gaeozsd/CffId4TZnSXZz73\r\ntCVdNPNsqgAeIZVcUt984b35EQdr15Q2Gm9C7AOHNqe1WFrzw5nc5pg5vb4M\r\niz9tvneYsESB8IgVnS/bY7Oluiu0v0qjoro=\r\n=zwiU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"Gruntfile.js","scripts":{"test":"grunt test"},"_npmUser":{"name":"newhouse","email":"c.newhouse@gmail.com"},"licenses":[{"type":"MIT"}],"repository":{"url":"https://github.com/anvilco/grunt-embed.git","type":"git"},"description":"Grunt plugin to convert external scripts and stylesheets into embedded ones.","directories":{},"dependencies":{"@anvilco/resource-embedder":"^0.0.4"},"_hasShrinkwrap":false,"devDependencies":{"grunt":"~0.4.1","grunt-cli":"~0.1.9","grunt-contrib-clean":"~0.5.0","grunt-contrib-watch":"~0.5.3","grunt-contrib-nodeunit":"~0.2.0"},"_npmOperationalInternal":{"tmp":"tmp/grunt-embed_0.0.1_1655858006629_0.0016082508569708054","host":"s3://npm-registry-packages"}}},"time":{"created":"2022-06-22T00:33:26.628Z","modified":"2025-11-12T22:03:18.678Z","0.0.1":"2022-06-22T00:33:26.773Z"},"bugs":{"url":"https://github.com/anvilco/grunt-embed/issues"},"author":{"url":"https://github.com/callumlocke","name":"Callum Locke"},"license":"MIT","homepage":"https://github.com/anvilco/grunt-embed","keywords":["gruntplugin"],"repository":{"url":"https://github.com/anvilco/grunt-embed.git","type":"git"},"description":"Grunt plugin to convert external scripts and stylesheets into embedded ones.","maintainers":[{"email":"services@useanvil.com","name":"anvilbot"},{"email":"derekfoster94@gmail.com","name":"fostimus"},{"email":"manggit@gmail.com","name":"manggit"},{"email":"manggit@useanvil.com","name":"manggit_anvil"}],"readme":"# grunt-embed\n\n[![Build Status](https://secure.travis-ci.org/callumlocke/grunt-embed.png?branch=master)](http://travis-ci.org/callumlocke/grunt-embed) [![Dependency Status](https://david-dm.org/callumlocke/grunt-embed.svg)](https://david-dm.org/callumlocke/grunt-embed)\n\n> This is a Grunt plugin wrapper around [resource-embedder](https://github.com/callumlocke/resource-embedder).\n\nTurns short external scripts and stylesheets into embedded ones:\n\n* `<script src=\"foo.js\"></script>` becomes `<script> ... </script>`\n* `<link rel=\"stylesheet\" href=\"bar.css\">` becomes `<style> ... </style>`\n\nThe default behaviour is to embed anything under 5KB in size, but this threshold is configurable.\n\n**Should you embed your scripts?** Depends. Embedding reduces the number of HTTP requests, and can reduce blocking of subsequent requests and page rendering, but it also means the resources can't be cached individually and shared between pages.\n\nYou should do your own measurements to work out if this is a good trade-off in your situation. But, as a guide: short, blocking scripts in the head are often a good candidate for embedding.\n\nA small Modernizr build is a good example: if it's embedded (as a script before your main stylesheet), it will have been executed and applied any special CSS classes to the `<html>` tag before your styles are received. Then as soon as the styles are received, any subsequent background-image downloads can be started immediately, because Modernizr's classes will already have been added to the `<html>` tag.\n\n\n## Getting Started\n\nThis plugin requires [Grunt](http://gruntjs.com/) (see [Getting Started](http://gruntjs.com/getting-started)).\n\nInstall:\n\n```shell\nnpm install grunt-embed --save-dev\n```\n\nLoad the task in your Gruntfile:\n\n```js\ngrunt.loadNpmTasks('grunt-embed');\n```\n\n\n## The \"embed\" task\n\n### Overview\n\nIn your Gruntfile, add a section named `embed` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n  embed: {\n    options: {\n      // Task-specific options go here.\n    },\n    your_target: {\n      // Target-specific file lists and/or options go here.\n    },\n  },\n})\n```\n\n### Options\n\nAny options will be passed through to `resource-embedder` – see [full list of options](https://github.com/callumlocke/resource-embedder#options).\n\n### Usage Examples\n\n#### Default Options\n\nEmbed any external scripts and stylesheets under 5KB in size (the default threshold):\n\n```js\ngrunt.initConfig({\n  embed: {\n    some_target: {\n      files: {\n        'dest/output.html': 'src/input.html'\n      }\n    }\n  }\n})\n```\n\n#### Custom Options\n\nCustom threshold – embed anything under 3KB in size:\n\n```js\ngrunt.initConfig({\n  embed: {\n    options: {\n      threshold: '3KB'\n    },\n    some_target: {\n      files: {\n        'dest/output.html': 'src/input.html'\n      }\n    }\n  }\n})\n```\n\n#### Overriding the options for a given script/stylesheet\n\nYou can use `data-embed` attributes to override the options for an individual resource.\n\n```html\n<script src=\"foo.js\" data-embed></script> <!-- always embed -->\n<script src=\"foo.js\" data-embed=\"false\"></script> <!-- never embed -->\n<script src=\"foo.js\" data-embed=\"10KB\"></script> <!-- embed if under 10KB -->\n```\n\n\n## Contributing\n\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\n\n\n## Release History\n\n_(Nothing yet)_\n\n\n## License\n\nCopyright (c) 2013 Callum Locke. Licensed under the MIT license.\n","readmeFilename":"README.md"}