{"name":"vue-hot-reload-api","version":"2.3.1","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.16.0","jest":"^21.2.1","vue":"^2.4.4"},"gitHead":"43b3e8d173f32b2558f8fd032a6cdab859ec2fa0","_id":"vue-hot-reload-api@2.3.1","_npmVersion":"6.4.1","_nodeVersion":"8.11.3","_npmUser":{"name":"yyx990803","email":"yyx990803@gmail.com"},"dist":{"integrity":"sha512-AA86yKZ5uOKz87/q1UpngEXhbRkaYg1b7HMMVRobNV1IVKqZe8oLIzo6iMocVwZXnYitlGwf2k4ZRLOZlS8oPQ==","shasum":"b2d3d95402a811602380783ea4f566eb875569a2","tarball":"http://registry-npm.ywwl.com/vue-hot-reload-api/download/vue-hot-reload-api-2.3.1.tgz","fileCount":4,"unpackedSize":10068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJboz+LCRA9TVsSAnZWagAAfcIQAIEyOZnQR7ujxWTMSI8k\nf3O3WfWXNZ1qjLPJ1Agq3DnUD93ikfbyBdka/k47VjTPBeIcUAyABdUgeljX\nKgPvpN7GryELy+cIWmoziQou04dfACJgZ/M8iY6Ie9sXSsGdEq9HKEKLiMUn\nlsm0MDWcwUYp5qpE7skSltPucMOdOoD0UlfqfSJdczuTlZ96X7YLU3AlNcbN\n3inCzAkT3hkxznK9G1pvsp/ylTLeVLp1XhWZy58EVtl+y9ouH12YkRVh2iFF\nxZ6RYexHU8RGH6cetloYCOE9l1qImdFnAvypc5zbiGz7FrO2ntmy3vBjamac\nfELX/PyeDJNnv5H7iwtI6zvzoZF9XO3kVZXG5KjO0/oeYvPfjp1cTPN4OZBG\nubgZMBBA0pJKCbRpW10Uc1kpbuvkY2ywa9d4cD0y0uRNxOxHzKBO9cuM9oHx\nwmvwEsD9YH+pQoh3e8S3rObBQQpvO1Rz64im/+Doz70BvqJM352iV8k4d6x8\nPOk6eBJaFTJxfYRCipxIJCgZxarx7RUHfhHiG7wS50JS7KhriNH+/tvlshEr\n9zx6MCgglZx4uGo3KdTdRVEuLdMwC20QSxDSBogTmFnJfrfpx61rueHEDXSm\nPKPsqDp+lR+v2MNQweXT9NzZ8B8b/y3DE2ulFqdQoAaA103krTe8EezZtE60\nWa96\r\n=DFbn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzlUeFablcEg9xE7368L/T5FjH+VlHZfTqMS4y7U12fQIhANFYves4AheC+KTWYZ29iymQiNTgLcW6bz+7KV6sIBcd"}],"size":3799,"noattachment":false,"key":"/vue-hot-reload-api/-/vue-hot-reload-api-2.3.1.tgz"},"maintainers":[{"name":"yyx990803","email":"yyx990803@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-hot-reload-api_2.3.1_1537425291329_0.7563710790595266"},"_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":1537425291466,"_cnpm_publish_time":1537425291466,"dist-tags":{"latest":"2.3.4"}}