{"name":"vue-hot-reload-api","version":"2.3.2","description":"hot reload api for *.vue components","main":"dist/index.js","scripts":{"build":"buble src -o dist","test":"jest","prepublishOnly":"npm run test && npm run build"},"repository":{"type":"git","url":"git+https://github.com/vuejs/vue-hot-reload-api.git"},"keywords":["vue","hot","reload"],"author":{"name":"Evan You"},"license":"MIT","bugs":{"url":"https://github.com/vuejs/vue-hot-reload-api/issues"},"homepage":"https://github.com/vuejs/vue-hot-reload-api#readme","devDependencies":{"buble":"^0.19.6","jest":"^23.6.0","vue":"^2.5.21"},"gitHead":"93942d07611b3b514d499c33fbd588cbfd49e1a7","_id":"vue-hot-reload-api@2.3.2","_npmVersion":"6.4.1","_nodeVersion":"10.14.1","_npmUser":{"name":"yyx990803","email":"yyx990803@gmail.com"},"dist":{"integrity":"sha512-NpznMQoe/DzMG7nJjPkJKT7FdEn9xXfnntG7POfTmqnSaza97ylaBf1luZDh4IgV+vgUoR//id5pf8Ru+Ym+0g==","shasum":"1fcc1495effe08a790909b46bf7b5c4cfeb6f21b","tarball":"http://registry-npm.ywwl.com/vue-hot-reload-api/download/vue-hot-reload-api-2.3.2.tgz","fileCount":4,"unpackedSize":10839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcYaaECRA9TVsSAnZWagAAaFAP+QFhseQp5YuBi+5eRv+9\njOo4Z37jZVAjYC23p5NIFMMxi7IXNENcTZQx2tRlE1kdRVPpCVDruZ63pWKQ\nrd8NPmWgCTAK2MbH0TdEMo5F1TMUtDV9Pfdc7haR/yriHQ8A5QH6Ib3Ztf70\ngktyIKt3Vok+nBWUDm20XlPmpoXjoBB0hcsSdjx343+NEHEVxPTVYx5hqD4m\naKKKJjw/Hwo4xzjkwQwnneqW8hQDZw8w0JqDD6R9tZpDgyYC8TVIwaeLgOdS\nqVEgkrKil1qP+8P+/msmk7cNmW9KskbeC3awPSjIVSd0Sw7ZkyMHWCQumejA\n6uT9tnNoeMrlTIMYbYU8IOu2yK8CXWNUDEZEUX7gru5PCj7WsbkNEZKS3p19\nBjKSfclmnTjwSdzVfH4pmjGoMTyoehsyJDFqb33nFGiY5HC8/AULuihYCCuM\n55XfMZmbcMp9Q2Q3nQ7Iqg/QHM83ODtd2v2dLzbWFYxIVjACx77U/OsZj1Kq\nyNVnQYXIpyaEc8eoO+qe2UWQVbVeEVhTDsta0a7rJhxK/5c8So5XU1v9dn36\nJPqiR0GcktsK2vx1/x0DA+gf/C4VOpOrgBq8ZeAzyrl5l11mLM2abp8GJceb\nOcpBIBnFgIPXl8u9VhTxWBg5GNGbtaxT1JhAE/jT+NUpyZ8c2n3LwEa7w30l\nZ3c2\r\n=gTs5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7mE5V5enwW+m2+9EhH7n3RyC5NXpDf3ooPIPOQfIkPgIgUtt4ZrVuY5JdhC72a2NXd8aL/tlgtcQD1ZE0zwNaGxY="}],"size":4080,"noattachment":false,"key":"/vue-hot-reload-api/-/vue-hot-reload-api-2.3.2.tgz"},"maintainers":[{"name":"yyx990803","email":"yyx990803@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-hot-reload-api_2.3.2_1549903492076_0.3535480921745664"},"_hasShrinkwrap":false,"readme":"# vue-hot-reload-api\n\n> Note: `vue-hot-reload-api@2.x` only works with `vue@2.x`\n\nHot reload API for Vue components. This is what [vue-loader](https://github.com/vuejs/vue-loader) and [vueify](https://github.com/vuejs/vueify) use under the hood.\n\n## Usage\n\nYou will only be using this if you are writing some build toolchain based on Vue components. For normal application usage, just use `vue-loader` or `vueify`.\n\n``` js\n// define a component as an options object\nconst myComponentOptions = {\n  data () { ... },\n  created () { ... },\n  render () { ... }\n}\n\n// assuming Webpack's HMR API.\n// https://webpack.js.org/guides/hot-module-replacement/\nif (module.hot) {\n  const api = require('vue-hot-reload-api')\n  const Vue = require('vue')\n\n  // make the API aware of the Vue that you are using.\n  // also checks compatibility.\n  api.install(Vue)\n\n  // compatibility can be checked via api.compatible after installation\n  if (!api.compatible) {\n    throw new Error('vue-hot-reload-api is not compatible with the version of Vue you are using.')\n  }\n\n  // indicate this module can be hot-reloaded\n  module.hot.accept()\n\n  if (!module.hot.data) {\n    // for each component option object to be hot-reloaded,\n    // you need to create a record for it with a unique id.\n    // do this once on startup.\n    api.createRecord('very-unique-id', myComponentOptions)\n  } else {\n    // if a component has only its template or render function changed,\n    // you can force a re-render for all its active instances without\n    // destroying/re-creating them. This keeps all current app state intact.\n    api.rerender('very-unique-id', myComponentOptions)\n\n    // --- OR ---\n\n    // if a component has non-template/render options changed,\n    // it needs to be fully reloaded. This will destroy and re-create all its\n    // active instances (and their children).\n    api.reload('very-unique-id', myComponentOptions)\n  }\n}\n```\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n","publish_time":1549903492175,"_cnpm_publish_time":1549903492175,"dist-tags":{"latest":"2.3.4"}}