{"name":"assets-webpack-plugin","version":"3.9.5-alpha.2","description":"Emits a json file with assets paths","main":"dist/index.js","scripts":{"lint":"standard --verbose | snazzy","test":"mocha test","build":"babel index.js --out-dir dist && babel lib --out-dir dist/lib","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/ztoben/assets-webpack-plugin.git"},"keywords":["webpack","plugin","generate","assets","hashes"],"author":{"name":"Sebastian Porto"},"license":"MIT","bugs":{"url":"https://github.com/ztoben/assets-webpack-plugin/issues"},"homepage":"https://github.com/ztoben/assets-webpack-plugin","files":["index.js","dist/"],"devDependencies":{"babel-cli":"6.26.0","babel-core":"6.26.3","babel-preset-env":"1.7.0","chai":"^4.1.2","css-loader":"^1.0.0","lodash":"^4.17.10","mini-css-extract-plugin":"^0.4.0","mocha":"^5.2.0","rimraf":"^2.6.2","snazzy":"^7.1.1","standard":"^11.0.1","style-loader":"^0.22.0","webpack":"4.16.5"},"dependencies":{"camelcase":"^5.0.0","escape-string-regexp":"^1.0.3","lodash.assign":"^4.2.0","lodash.merge":"^4.6.1","mkdirp":"^0.5.1"},"contributors":[{"name":"Zach Toben","url":"https://github.com/ztoben"},{"name":"Jonny Gerig Meyer","url":"https://github.com/jgerigmeyer"},{"name":"Joe Lencioni","url":"https://github.com/lencioni"},{"name":"airwin","url":"https://github.com/airwin"},{"name":"Yuriy Grunin","url":"https://github.com/th0r"},{"name":"Kane","url":"https://github.com/kane-c"},{"name":"Sebastian Porto","url":"https://github.com/sporto"},{"url":"https://github.com/apps/greenkeeper"},{"name":"Rostislav","url":"https://github.com/galkinrost"},{"name":"Danny Guo","url":"https://github.com/dguo"},{"name":"Matt Krick","url":"https://github.com/mattkrick"},{"name":"Dmitriy Kubyshkin","url":"https://github.com/grassator"},{"name":"Túlio Ornelas","url":"https://github.com/tulios"},{"name":"Dido Arellano","url":"https://github.com/didoarellano"},{"url":"https://github.com/dimchez"},{"name":"Islam Sharabash","url":"https://github.com/ibash"},{"name":"Alex Afonin","url":"https://github.com/Tuch"},{"name":"Hugo Monteiro","url":"https://github.com/monteiro"},{"name":"Ernesto Rocha","url":"https://github.com/ernestorocha"},{"name":"Germán Méndez Bravo","url":"https://github.com/Kronuz"},{"name":"Wout Mertens","url":"https://github.com/wmertens"},{"url":"https://github.com/ju1ius"},{"name":"Sasha Koss","url":"https://github.com/kossnocorp"}],"readme":"# assets-webpack-plugin\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![npm package](https://img.shields.io/npm/v/assets-webpack-plugin.svg?style=flat)](https://www.npmjs.org/package/assets-webpack-plugin)\n[![Build Status](https://travis-ci.org/ztoben/assets-webpack-plugin.svg?branch=master)](https://travis-ci.org/ztoben/assets-webpack-plugin)\n[![Build status](https://ci.appveyor.com/api/projects/status/sbchndv12vk45mo3?svg=true)](https://ci.appveyor.com/project/ztoben/assets-webpack-plugin)\n[![Greenkeeper badge](https://badges.greenkeeper.io/ztoben/assets-webpack-plugin.svg)](https://greenkeeper.io/)\n\nWebpack plugin that emits a json file with assets paths.\n\n## Table of Contents\n\n- [Why Is This Useful?](#why-is-this-useful)\n\n- [Install](#install)\n\n- [Configuration](#configuration)\n\n- [Test](#test)\n\n- [Change Log](./changelog.md)\n\n- [Contributing Guidelines](./contributing.md)\n\n- [Contributors](./contributors.md)\n\n## Why Is This Useful?\n\nWhen working with Webpack you might want to generate your bundles with a generated hash in them (for cache busting).\n\nThis plug-in outputs a json file with the paths of the generated assets so you can find them from somewhere else.\n\n### Example output:\n\nThe output is a JSON object in the form:\n\n```json\n{\n    \"bundle_name\": {\n        \"asset_kind\": \"/public/path/to/asset\"\n    }\n}\n```\n\nWhere:\n\n  * `\"bundle_name\"` is the name of the bundle (the key of the entry object in your webpack config, or \"main\" if your entry is an array).\n  * `\"asset_kind\"` is the camel-cased file extension of the asset\n\nFor example, given the following webpack config:\n\n```js\n{\n    entry: {\n        one: ['src/one.js'],\n        two: ['src/two.js']\n    },\n    output: {\n        path: path.join(__dirname, \"public\", \"js\"),\n        publicPath: \"/js/\",\n        filename: '[name]_[hash].bundle.js'\n    }\n}\n```\n\nThe plugin will output the following json file:\n\n```json\n{\n    \"one\": {\n        \"js\": \"/js/one_2bb80372ebe8047a68d4.bundle.js\"\n    },\n    \"two\": {\n        \"js\": \"/js/two_2bb80372ebe8047a68d4.bundle.js\"\n    }\n}\n```\n\n## Install\n\n```sh\nnpm install assets-webpack-plugin --save-dev\n```\n\n## Configuration\n\nIn your webpack config include the plug-in. And add it to your config:\n\n```js\nvar path = require('path')\nvar AssetsPlugin = require('assets-webpack-plugin')\nvar assetsPluginInstance = new AssetsPlugin()\n\nmodule.exports = {\n    // ...\n    output: {\n        path: path.join(__dirname, \"public\", \"js\"),\n        filename: \"[name]-bundle-[hash].js\",\n        publicPath: \"/js/\"\n    },\n    // ....\n    plugins: [assetsPluginInstance]\n}\n```\n\n### Options\n\nYou can pass the following options:\n\n#### `filename`\n\nOptional. `webpack-assets.json` by default.\n\nName for the created json file.\n\n```js\nnew AssetsPlugin({filename: 'assets.json'})\n```\n\n#### `fullPath`\n\nOptional. `true` by default.\n\nIf `false` the output will not include the full path\nof the generated file.\n\n```js\nnew AssetsPlugin({fullPath: false})\n```\n\ne.g.\n\n`/public/path/bundle.js` vs `bundle.js vs`\n\n#### `includeManifest`\n\nOptional. `false` by default.\n\nInserts the manifest javascript as a `text` property in your assets.\nAccepts the name of your manifest chunk. A manifest is the last CommonChunk that\nonly contains the webpack bootstrap code. This is useful for production\nuse when you want to inline the manifest in your HTML skeleton for long-term caching.\nSee [issue #1315](https://github.com/webpack/webpack/issues/1315)\nor [a blog post](https://medium.com/@matt.krick/a-production-ready-realtime-saas-with-webpack-7b11ba2fa5b0#.p1vvfr3bm)\nto learn more.\n\n```js\nnew AssetsPlugin({includeManifest: 'manifest'})\n// assets.json:\n// {entries: {manifest: {js: `hashed_manifest.js`, text: 'function(modules)...'}}}\n//\n// Your html template:\n// <script>\n// {assets.entries.manifest.text}\n// </script>\n```\n\n#### `manifestFirst`\n\nOptional. `false` by default.\n\nOrders the assets output so that manifest is the first entry. This is useful for cases where script tags are generated\nfrom the assets json output, and order of import is important.\n\n```js\nnew AssetsPlugin({manifestFirst: true})\n``` \n\n#### `path`\n\nOptional. Defaults to the current directory.\n\nPath where to save the created JSON file. Will default to the highest level of the project unless useCompilerPath is specified.\n\n```js\nnew AssetsPlugin({path: path.join(__dirname, 'app', 'views')})\n```\n\n#### `useCompilerPath`\n\n```js\nnew AssetsPlugin({useCompilerPath: true})\n```\n\nWill override the path to use the compiler output path set in your webpack config.\n\n#### `prettyPrint`\n\nOptional. `false` by default.\n\nWhether to format the JSON output for readability.\n\n```js\nnew AssetsPlugin({prettyPrint: true})\n```\n\n#### `processOutput`\n\nOptional. Defaults is JSON stringify function.\n\nFormats the assets output.\n\n```js\nnew AssetsPlugin({\n  processOutput: function (assets) {\n    return 'window.staticMap = ' + JSON.stringify(assets)\n  }\n})\n```\n\n#### `update`\n\nOptional. `false` by default.\n\nWhen set to `true`, the output JSON file will be updated instead of overwritten.\n\n```js\nnew AssetsPlugin({update: true})\n```\n\n#### `metadata`\n\nInject metadata into the output file. All values will be injected into the key \"metadata\".\n\n```js\nnew AssetsPlugin({metadata: {version: 123}})\n// Manifest will now contain:\n// {\n//   metadata: {version: 123}\n// }\n```\n\n#### `includeAllFileTypes`\n\nOptional. `true` by default.\n\nWhen set false, falls back to the `fileTypes` option array to decide while file types to include in the assets file.\n\n```js\nnew AssetsPlugin({includeAllFileTypes: false})\n```\n\n#### `fileTypes`\n\nOptional. ```['js', 'css']``` by default.\n\nWhen set and `includeAllFileTypes` is set false, only assets matching these types will be included in the assets file.\n\n```js\nnew AssetsPlugin({fileTypes: ['js', 'jpg']})\n```\n\n#### `keepInMemory`\n\nOptional. `false` by default.\n\nWhen set the assets file will only be generated in memory while running `webpack-dev-server` and not written to disk.\n\n```js\nnew AssetsPlugin({keepInMemory: true})\n```\n\n### Using in multi-compiler mode\n\nIf you use webpack multi-compiler mode and want your assets written to a single file,\nyou **must** use the same instance of the plugin in the different configurations.\n\nFor example:\n\n```js\nvar webpack = require('webpack')\nvar AssetsPlugin = require('assets-webpack-plugin')\nvar assetsPluginInstance = new AssetsPlugin()\n\nwebpack([\n  {\n    entry: {one: 'src/one.js'},\n    output: {path: 'build', filename: 'one-bundle.js'},\n    plugins: [assetsPluginInstance]\n  },\n  {\n    entry: {two:'src/two.js'},\n    output: {path: 'build', filename: 'two-bundle.js'},\n    plugins: [assetsPluginInstance]\n  }\n])\n```\n\n\n### Using this with Rails\n\nYou can use this with Rails to find the bundled Webpack assets via Sprockets.\nIn `ApplicationController` you might have:\n\n```ruby\ndef script_for(bundle)\n  path = Rails.root.join('app', 'views', 'webpack-assets.json') # This is the file generated by the plug-in\n  file = File.read(path)\n  json = JSON.parse(file)\n  json[bundle]['js']\nend\n```\n\nThen in the actions:\n\n```ruby\ndef show\n  @script = script_for('clients') # this will retrieve the bundle named 'clients'\nend\n```\n\nAnd finally in the views:\n\n```erb\n<div id=\"app\">\n  <script src=\"<%= @script %>\"></script>\n</div>\n```\n\n## Test\n\n```sh\nnpm test\n```\n","readmeFilename":"readme.md","gitHead":"1d739f014fff26e1ccbfa15faaec3fb8923f6fa3","_id":"assets-webpack-plugin@3.9.5-alpha.2","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"ztoben","email":"zach.toben@gmail.com"},"dist":{"integrity":"sha512-cEdpJ4lr1aWTO8ksBPaLj2AJiEiCJjgdRLrpdNfotyRoRYAZnZ+qVLyt7qmfMD2zM3sxELwNmSLKRVlEvr9TVQ==","shasum":"d31eb3bba4e938a56db8b8086f97030a8a18de27","tarball":"http://registry-npm.ywwl.com/assets-webpack-plugin/download/assets-webpack-plugin-3.9.5-alpha.2.tgz","fileCount":14,"unpackedSize":37545,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdv+FCRA9TVsSAnZWagAAh2YP/2SZiNIizvjRUl+F8eqJ\nuGz6HXIsZ71NqPSZC6wbQ0OJTXHTcIBnvDIPBeyUd5ZsNY6uGR9uhcSbM9pc\nXjeL/B5PdvvjKEpIePuKA9K08fZ8rx06MnigU7g6g22sD+Cm+hiMO1Lj1fP6\nswSxf1C2JkYM8jgSo6oDJsACYDuNrgnss7gqmkayD6yNPqM9cUC/SHM5eo2s\nd6au1fAWK85kgOYH6QwpVpTE/Lnx3xXcekfQZ8i5FkI5A7QQnrvbG1+0uUJF\nxpQLgdY71FUl+64L9T0lDyyCNQ17tGcj0HcY9a2WMY6cAgcmNIsPI96S8IaQ\nVsLl7ugTK4K1h1mITegJTzenNf4QGLz6+HXFAWy5mrPFQel28+axIRZTZTsY\nk0IHTKq2j1bat2WCaZ1M6qRViLPjbj4tOOXkeKuXsFZNQGpeia+2rLzrZ7BW\nSDBLZnJypGzab+VninS13RmER2qWUSW3/4UDWxjKnWBItr0udcAqTieRon8f\nKGI+Bvo5X7BnsQzVDjCIVWO63UTcjyMhdq6946TLQNmRXTzPJKkt7bKwtu1G\nwocqTMsH2wt+39NZIWjK+lIKq67FH3zFnAg5whnJQQBM42WR4rQz38UAW97Q\nw74PIT3ug7dcYdHwH5HLio1lbO0jtW7Qy8F6nt0d677Swl1yy6HvfypcprYc\n9Qfe\r\n=TF3x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjrfqI5FP+icCwXCBMXoQE30hs7DLPERZbmjeQonL9rQIgAmCmHAY01G7AwI4pg6KhChJljadwbRq/bfoupWrc2tQ="}],"size":10655,"noattachment":false,"key":"/assets-webpack-plugin/-/assets-webpack-plugin-3.9.5-alpha.2.tgz"},"maintainers":[{"name":"kossnocorp","email":"kossnocorp@gmail.com"},{"name":"sporto","email":"sebasporto@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/assets-webpack-plugin_3.9.5-alpha.2_1534525316273_0.8797718188223151"},"_hasShrinkwrap":false,"publish_time":1534525316362,"_cnpm_publish_time":1534525316362,"dist-tags":{"alpha":"6.0.0-alpha.5","latest":"7.1.1"}}