{"_id":"@chenbeiliuhuo/assets-webpack-plugin-steamer","_rev":"1-982e9e4944e7ffe79fe0cedaf7cfc106","name":"@chenbeiliuhuo/assets-webpack-plugin-steamer","dist-tags":{"latest":"3.5.1"},"versions":{"3.5.1":{"_from":"assets-webpack-plugin-steamer","_id":"@chenbeiliuhuo/assets-webpack-plugin-steamer@3.5.1","_inBundle":false,"_integrity":"sha1-voyQ0N5IJ2K9KqjreGugOdiYGIE=","_location":"/assets-webpack-plugin-steamer","_phantomChildren":{"lodash._arraycopy":"3.0.0","lodash._arrayeach":"3.0.0","lodash._createassigner":"3.1.1","lodash._getnative":"3.9.1","lodash.isarguments":"3.1.0","lodash.isarray":"3.0.4","lodash.isplainobject":"3.2.0","lodash.istypedarray":"3.0.6","lodash.keys":"3.1.2","lodash.keysin":"3.0.8","lodash.toplainobject":"3.0.0"},"_requested":{"type":"tag","registry":true,"raw":"assets-webpack-plugin-steamer","name":"assets-webpack-plugin-steamer","escapedName":"assets-webpack-plugin-steamer","rawSpec":"","saveSpec":null,"fetchSpec":"latest"},"_requiredBy":["#USER","/"],"_resolved":"http://r.tnpm.oa.com/assets-webpack-plugin-steamer/download/assets-webpack-plugin-steamer-3.5.1.tgz","_shasum":"be8c90d0de482762bd2aa8eb786ba039d8981881","_spec":"assets-webpack-plugin-steamer","_where":"/Users/burlinchen/Project/git-tencent/tencent-doc/feature-components","author":{"name":"Sebastian Porto"},"bugs":{"url":"https://github.com/sporto/assets-webpack-plugin/issues"},"bundleDependencies":false,"dependencies":{"camelcase":"^1.2.1","escape-string-regexp":"^1.0.3","lodash.assign":"^3.2.0","lodash.merge":"^3.3.2","mkdirp":"^0.5.1"},"deprecated":false,"description":"Emits a json file with assets paths","devDependencies":{"chai":"^3.0.0","css-loader":"^0.9.1","extract-text-webpack-plugin":"^0.3.8","lodash":"^3.9.3","mocha":"^2.2.5","rimraf":"^2.2.8","snazzy":"^3.0.0","standard":"^6.0.8","style-loader":"^0.8.3","webpack":"^1.3.3-beta1"},"homepage":"https://github.com/sporto/assets-webpack-plugin","keywords":["webpack","plugin","generate","assets","hashes"],"license":"MIT","main":"index.js","name":"@chenbeiliuhuo/assets-webpack-plugin-steamer","repository":{"type":"git","url":"git+https://github.com/sporto/assets-webpack-plugin.git"},"scripts":{"lint":"standard --verbose | snazzy","test":"mocha test"},"version":"3.5.1","gitHead":"f8479362d9f651bde6af2e04d86ab8fc1f6c6016","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-srCeQ7Qf3nefA34jXB3mbRQmiawQIqH21NaMaZaB4PTwHzyK9X15JX4OxHnLiN6zpOx+Xr2YnG/YVshHfoB85Q==","shasum":"867e7f0fc65b236f3067e501c430453eec39259b","tarball":"https://registry.npmjs.org/@chenbeiliuhuo/assets-webpack-plugin-steamer/-/assets-webpack-plugin-steamer-3.5.1.tgz","fileCount":33,"unpackedSize":57774,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexNurCRA9TVsSAnZWagAAMNsP/RQlBibpPyE/p/uubDcd\n11FwjLZKBcipEUgB5pPkV8wrG7y6rzDa8Q10QEf9ac8O+CEQV08mBjqPDi2f\nM1ix+JYhRA3aXHL/atK3T4pTHVGvWOfcrRsf73W5hIFB/Py5Zm/geZPgJop1\nEXk/qD2kJPcaNTFI5gNBrIEJMDPiHVKDcrJANIPP+vmwaHiSlG3LVNkmJcP0\nwP1mqQGYIkHAnxQzHQQQNpNeEBcYeOSDlVIPynvfVofJ1IRQrBiZn44H1+Yk\nuATBolYrARF2ohk+F2q7mHAXzG5Ba/VuA3Amq2fFlBjWtrjoYIytc/2ZzOg+\neN3HPJDTqAgu8nDHUPYvp09IxBiQkqrcXDqaybNMxXASYxEl4xr0Q04fr9jV\nKT5DQFBdPMSsOhDIWRSGze0JwlD4+8KCHVtbzNqDFWRwsPtKdEB9uh9+GzUW\nWVDE6HwvIVIyDtk4Plj6M3EUqNOyq7vrdk6K2bkfNoTbgupGVRJoh1yYAouu\nteeeSPRMpx0r5lT6ItP9BYz7SBWIbxZLbSLzk6DMA7LHf2R2cO59ar1BU5MD\nDln59PK4wSWBD9AnLmj3WA+3ZM4VlDQp9cZOexe6kUfBgmX3u+nsbJkvuGDW\npcc6kyxDF9VgipmSR1f7IQeQISC0rKAmZSu4NTz1J2fdCF1ffY+A72NAL5ER\nrDMs\r\n=2Ecr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTCCm6sgHde1OEus+1DITkEsNUhlOrW3qGAtMYXDd2dAIhAK5BBh2o+gq4MDy5jknXxP2/io66gEI7BAg7bEVJjxED"}]},"maintainers":[{"name":"cblh","email":"chenbeiliuhuo@gmail.com"}],"_npmUser":{"name":"cblh","email":"chenbeiliuhuo@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/assets-webpack-plugin-steamer_3.5.1_1589959595414_0.4676047071795171"},"_hasShrinkwrap":false}},"time":{"created":"2020-05-20T07:26:35.152Z","3.5.1":"2020-05-20T07:26:35.570Z","modified":"2022-04-04T22:38:39.406Z"},"maintainers":[{"name":"cblh","email":"chenbeiliuhuo@gmail.com"}],"description":"Emits a json file with assets paths","homepage":"https://github.com/sporto/assets-webpack-plugin","keywords":["webpack","plugin","generate","assets","hashes"],"repository":{"type":"git","url":"git+https://github.com/sporto/assets-webpack-plugin.git"},"author":{"name":"Sebastian Porto"},"bugs":{"url":"https://github.com/sporto/assets-webpack-plugin/issues"},"license":"MIT","readme":"# assets-webpack-plugin\r\n[![Build Status](https://travis-ci.org/kossnocorp/assets-webpack-plugin.svg?branch=master)](https://travis-ci.org/kossnocorp/assets-webpack-plugin) [![Build status](https://ci.appveyor.com/api/projects/status/qmvi3h6lk0xu8833?svg=true)](https://ci.appveyor.com/project/kossnocorp/assets-webpack-plugin)\r\n\r\nWebpack plugin that emits a json file with assets paths.\r\n\r\n## Table of Contents\r\n\r\n- [Why Is This Useful?](#why-is-this-useful)\r\n\r\n- [Install](#install)\r\n\r\n- [Configuration](#configuration)\r\n\r\n- [Test](#test)\r\n\r\n- [Change Log](./CHANGELOG.md)\r\n\r\n- [Contributing Guidelines](./CONTRIBUTING.md)\r\n\r\n## Why Is This Useful?\r\n\r\nWhen working with Webpack you might want to generate your bundles with a generated hash in them (for cache busting).\r\n\r\nThis plug-in outputs a json file with the paths of the generated assets so you can find them from somewhere else.\r\n\r\n### Example output:\r\n\r\nThe output is a JSON object in the form:\r\n\r\n```json\r\n{\r\n    \"bundle_name\": {\r\n        \"asset_kind\": \"/public/path/to/asset\"\r\n    }\r\n}\r\n```\r\n\r\nWhere:\r\n\r\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).\r\n  * `\"asset_kind\"` is the camel-cased file extension of the asset\r\n\r\nFor example, given the following webpack config:\r\n\r\n```js\r\n{\r\n    entry: {\r\n        one: ['src/one.js'],\r\n        two: ['src/two.js']\r\n    },\r\n    output: {\r\n        path: path.join(__dirname, \"public\", \"js\"),\r\n        publicPath: \"/js/\",\r\n        filename: '[name]_[hash].bundle.js'\r\n    }\r\n}\r\n```\r\n\r\nThe plugin will output the following json file:\r\n\r\n```json\r\n{\r\n    \"one\": {\r\n        \"js\": \"/js/one_2bb80372ebe8047a68d4.bundle.js\"\r\n    },\r\n    \"two\": {\r\n        \"js\": \"/js/two_2bb80372ebe8047a68d4.bundle.js\"\r\n    }\r\n}\r\n```\r\n\r\n## Install\r\n\r\n```sh\r\nnpm install assets-webpack-plugin --save-dev\r\n```\r\n\r\n## Configuration\r\n\r\nIn your webpack config include the plug-in. And add it to your config:\r\n\r\n```js\r\nvar path = require('path')\r\nvar AssetsPlugin = require('assets-webpack-plugin')\r\nvar assetsPluginInstance = new AssetsPlugin()\r\n\r\nmodule.exports = {\r\n    // ...\r\n    output: {\r\n        path: path.join(__dirname, \"public\", \"js\"),\r\n        filename: \"[name]-bundle-[hash].js\",\r\n        publicPath: \"/js/\"\r\n    },\r\n    // ....\r\n    plugins: [assetsPluginInstance]\r\n}\r\n```\r\n\r\n### Options\r\n\r\nYou can pass the following options:\r\n\r\n#### `filename`\r\n\r\nOptional. `webpack-assets.json` by default.\r\n\r\nName for the created json file.\r\n\r\n```js\r\nnew AssetsPlugin({filename: 'assets.json'})\r\n```\r\n\r\n#### `fullPath`\r\n\r\nOptional. `true` by default.\r\n\r\nIf `false` the output will not include the full path\r\nof the generated file.\r\n\r\n```js\r\nnew AssetsPlugin({fullPath: false})\r\n```\r\n\r\ne.g.\r\n\r\n`/public/path/bundle.js` vs `bundle.js vs`\r\n\r\n#### `includeManifest`\r\n\r\nOptional. `false` by default.\r\n\r\nInserts the manifest javascript as a `text` property in your assets.\r\nAccepts the name of your manifest chunk. A manifest is the last CommonChunk that\r\nonly contains the webpack bootstrap code. This is useful for production\r\nuse when you want to inline the manifest in your HTML skeleton for long-term caching.\r\nSee [issue #1315](https://github.com/webpack/webpack/issues/1315)\r\nor [a blog post](https://medium.com/@matt.krick/a-production-ready-realtime-saas-with-webpack-7b11ba2fa5b0#.p1vvfr3bm)\r\nto learn more.\r\n\r\n```js\r\nnew AssetsPlugin({includeManifest: 'manifest'})\r\n// assets.json:\r\n// {entries: {manifest: {js: `hashed_manifest.js`, text: 'function(modules)...'}}}\r\n//\r\n// Your html template:\r\n// <script>\r\n// {assets.entries.manifest.text}\r\n// </script>\r\n```\r\n\r\n#### `path`\r\n\r\nOptional. Defaults to the current directory.\r\n\r\nPath where to save the created JSON file.\r\n\r\n```js\r\nnew AssetsPlugin({path: path.join(__dirname, 'app', 'views')})\r\n```\r\n\r\n#### `prettyPrint`\r\n\r\nOptional. `false` by default.\r\n\r\nWhether to format the JSON output for readability.\r\n\r\n```js\r\nnew AssetsPlugin({prettyPrint: true})\r\n```\r\n\r\n#### `processOutput`\r\n\r\nOptional. Defaults is JSON stringify function.\r\n\r\nFormats the assets output.\r\n\r\n```js\r\nnew AssetsPlugin({\r\n  processOutput: function (assets) {\r\n    return 'window.staticMap = ' + JSON.stringify(assets)\r\n  }\r\n})\r\n```\r\n\r\n#### `update`\r\n\r\nOptional. `false` by default.\r\n\r\nWhen set to `true`, the output JSON file will be updated instead of overwritten.\r\n\r\n```js\r\nnew AssetsPlugin({update: true})\r\n```\r\n\r\n#### `metadata`\r\n\r\nInject metadata into the output file. All values will be injected into the key \"metadata\".\r\n\r\n```js\r\nnew AssetsPlugin({metadata: {version: 123}})\r\n// Manifest will now contain:\r\n// {\r\n//   metadata: {version: 123}\r\n// }\r\n```\r\n\r\n### Using in multi-compiler mode\r\n\r\nIf you use webpack multi-compiler mode and want your assets written to a single file,\r\nyou **must** use the same instance of the plugin in the different configurations.\r\n\r\nFor example:\r\n\r\n```js\r\nvar webpack = require('webpack')\r\nvar AssetsPlugin = require('assets-webpack-plugin')\r\nvar assetsPluginInstance = new AssetsPlugin()\r\n\r\nwebpack([\r\n  {\r\n    entry: {one: 'src/one.js'},\r\n    output: {path: 'build', filename: 'one-bundle.js'},\r\n    plugins: [assetsPluginInstance]\r\n  },\r\n  {\r\n    entry: {two:'src/two.js'},\r\n    output: {path: 'build', filename: 'two-bundle.js'},\r\n    plugins: [assetsPluginInstance]\r\n  }\r\n])\r\n```\r\n\r\n\r\n### Using this with Rails\r\n\r\nYou can use this with Rails to find the bundled Webpack assets via Sprockets.\r\nIn `ApplicationController` you might have:\r\n\r\n```ruby\r\ndef script_for(bundle)\r\n  path = Rails.root.join('app', 'views', 'webpack-assets.json') # This is the file generated by the plug-in\r\n  file = File.read(path)\r\n  json = JSON.parse(file)\r\n  json[bundle]['js']\r\nend\r\n```\r\n\r\nThen in the actions:\r\n\r\n```ruby\r\ndef show\r\n  @script = script_for('clients') # this will retrieve the bundle named 'clients'\r\nend\r\n```\r\n\r\nAnd finally in the views:\r\n\r\n```erb\r\n<div id=\"app\">\r\n  <script src=\"<%= @script %>\"></script>\r\n</div>\r\n```\r\n\r\n## Test\r\n\r\n```sh\r\nnpm test\r\n```\r\n","readmeFilename":"readme.md"}